Created
November 1, 2011 17:59
-
-
Save headius/1331362 to your computer and use it in GitHub Desktop.
Workaround for broken 'fiber' library load on 1.6.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I merged across a change in the package name for FiberExtLibrary but did | |
# not merge across a subsequent change to load the library from that package. | |
# The following change loads the extension associated with the 'fiber' | |
# library directly. | |
# If you are using the 'fiber' library, rescue that require with this code. | |
# My apologies on such a stupid regression :) | |
require 'jruby' | |
org.jruby.ext.fiber.FiberExtLibrary.new.load(JRuby.runtime, false) | |
class org::jruby::ext::fiber::ThreadFiber | |
field_accessor :state | |
end | |
class Fiber | |
def alive? | |
JRuby.reference(self).state != org.jruby.ext.fiber.ThreadFiberState::FINISHED | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment