I was looking at threads.rb for Ruby 1.6, and I noticed that Mutex,
ConditionVariable (which uses Mutex), Queue, and SizedQueue explicitly
set Thread.critical to false when they're done.

This causes interesting behavior:

require "thread"
m = Mutex.new
Thread.critical = true
m.lock
p Thread.critical #=> false

I think this wouldn't happen if those functions either used
Thread.exclusive or were careful to restore Thread.critical to how it
was.

Alternatively, one could just use Mutexes for everything, is that
better?  It might make for more efficient ports to native threads. 
(BTW, will that ever happen?  Should I care?)

-- 
Tom Felker

It might look like I'm standing motionless, but I'm actively waiting for
my 
problems to go away.