Brent, we are looking for Ruby to officially allow Thread.critical= to bemplemented as a single non-reentrant mutex. This would help convince people writing Ruby libraries in the future to use Thread.critical= without assuming that other threads will be descheduled. Otherwise, they can push back on JRuby and IronRuby as not being fully-compatible.

The proposed spec I wrote up would clean things up even more. For example, you said "Thread.critical=false exits the critical section, regardless ofow many times it had been been redundantly set true." However, consider the case where thread A sets Thread.critical=true, and then thread B does Thread.critical=false. (Note that even MRI will schedule other threads under certain circumstances like a newly created thread or if thread A does Kernel#sleep). In this case, you cannot force thread A to release the mutex.our wording could possibly still be supported, for example, by having thread B create a new mutex and publish that as the single non-reentrant mutexo be used henceforth. I think such clean up would be good without causingoo much incompatilibiles.

However, we don't have to do all of these changes if compatability is a significant concern. As long as descheduling of other threads was not a requirement, that would go a long way.

Regards,
Shri