If the mutex is locked, unlocks the mutex, wakes one waiting thread, and yields in a critical section.
Source Code
# File thread.rb, line 140 def exclusive_unlock return unless @locked Thread.exclusive do @locked = false begin t = @waiting.shift t.wakeup if t rescue ThreadError retry end yield end self end
<code/>and<pre/>for code samples.