Thread.abort_on_exception is broken on windows
----------------------------------------------
Key: JRUBY-1609
URL: http://jira.codehaus.org/browse/JRUBY-1609
Project: JRuby
Issue Type: Bug
Environment: Windows XP SP1
Reporter: Wirianto Djunaidi
Assignee: Thomas E Enebo
Priority: Critical
running the following example from pickaxe book:
#! /usr/bin/ruby
Thread.abort_on_exception = true
threads = []
4.times do |number|
threads << Thread.new(number) do |i|
sleep(rand(0.1))
raise "Boom!" if i == 2
print "#{i}\n"
end
end
threads.each { |t| t.join }
and got the following exceptions:
Exception in thread "main" java.lang.ClassCastException: org.jruby.RubyClass can
not be cast to org.jruby.RubyThread
at org.jruby.RubyThreadInvoker$abort_on_exception_set_method_1_0.call(Un
known Source)
at org.jruby.RubyObject.callMethod(RubyObject.java:511)
at org.jruby.runtime.Dispatcher$DefaultDispatcher.callMethod(Dispatcher.
java:15)
at org.jruby.RubyObject.callMethod(RubyObject.java:494)
at org.jruby.javasupport.util.RuntimeHelpers.compilerCallMethodWithIndex
(RuntimeHelpers.java:264)
at org.jruby.javasupport.util.RuntimeHelpers.doAttrAssignIndexed(Runtime
Helpers.java:229)
at thread_exception2.__file__(thread_exception2.rb:3)
at thread_exception2.load(thread_exception2.rb)
at org.jruby.Ruby.runScript(Ruby.java:588)
at org.jruby.Ruby.runNormally(Ruby.java:510)
at org.jruby.Ruby.runFromMain(Ruby.java:433)
at org.jruby.Main.runInterpreter(Main.java:227)
at org.jruby.Main.runInterpreter(Main.java:183)
at org.jruby.Main.run(Main.java:116)
at org.jruby.Main.run(Main.java:93)
at org.jruby.Main.main(Main.java:84)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email