Robert Klemme said:
>> yes of course - i've always wondered why that one doesn't take a
> block...
>
> I guess because normally it's not intended for use in the open range.
> Normally one would use higher level constructs such as Mutex, Queue etc.

require 'thread'

Thread.exclusive{
  // Critical Code Here
}

-- 
-- Jim Weirich     jim / weirichhouse.org    http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)