Created
February 7, 2016 13:05
-
-
Save kares/c6a61a2cb73c0832af1e to your computer and use it in GitHub Desktop.
ThreadGroup#list patch for JRuby 1.7.4 (-1.7.18)
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
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