Skip to content

Instantly share code, notes, and snippets.

@headius
Created November 1, 2011 17:59
Show Gist options
  • Save headius/1331362 to your computer and use it in GitHub Desktop.
Save headius/1331362 to your computer and use it in GitHub Desktop.
Workaround for broken 'fiber' library load on 1.6.5
# 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