Re: Threads issue.



Joining a stopped thread causes a deadlock.

Consider this deadlocking code:

Thread.fork do
Thread.stop
end.join

On the other hand, the following code does work:

Thread.fork do
Thread.stop
end.run.join

To prove that Thread.stop was really executed, I ran both
scripts with a trace:

http://www.erikveen.dds.nl/tmp/code1.trace.png
http://www.erikveen.dds.nl/tmp/code2.trace.png

gegroet,
Erik V. - http://www.erikveen.dds.nl/


.