unhandled exception in thread causes ruby to lose control

S

Shea Martin

<code>
Thread.abort_on_exception = true

t = Thread.new{
puts "here"
raise "exception"
}

sleep 3
puts "t thread is #{t.alive?}"

exit 0
</code>

The above code will cause ruby to eatup 100% cpu, for an infinite amount
of time on win32. If Thread.abort_on_exception is set to false, things
work as expected.

I think this is a bug. ruby 1.8.4 (2005-12-24) [i386-mswin32]

~S
 
J

James Britt

Shea said:
<code>
Thread.abort_on_exception = true

t = Thread.new{
puts "here"
raise "exception"
}

sleep 3
puts "t thread is #{t.alive?}"

exit 0
</code>

The above code will cause ruby to eatup 100% cpu, for an infinite amount
of time on win32.

WinXP pro, SP2: Code works just fine.

d:\temp>tex.rb
here
d:/temp/tex.rb:5: exception (RuntimeError)
from d:/temp/tex.rb:3

d:\temp>


James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top