Skip to content

Instantly share code, notes, and snippets.

@kares
Created February 7, 2016 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kares/c6a61a2cb73c0832af1e to your computer and use it in GitHub Desktop.
Save kares/c6a61a2cb73c0832af1e to your computer and use it in GitHub Desktop.
ThreadGroup#list patch for JRuby 1.7.4 (-1.7.18)
if JRUBY_VERSION < '1.7.19'
require 'thread'; require 'java'
org.jruby.RubyThreadGroup.field_reader :rubyThreadList
ThreadGroup.class_eval do
def list
threads = []
list = to_java.rubyThreadList
list.synchronized do # iterator must be sync-ed
list.each { |t| threads << t if t }
end
threads
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment