On 10 Dec 2004, at 22:27, leon breedt wrote:

> modifying the callback's Ruby code to contain:
>
> def cb
> Thread.critical = true

You may already be in a critical section here.

> ....
> ensure
> Thread.critical = false
> end

def cb
   old_critical = Thread.critical = true
   # ...
ensure
   Thread.critical = old_critical
end

(GC.disable/enable works the same way.)