Obtains a lock, runs the block, and releases the lock when the block completes. See the example under Mutex.
# File thread.rb, line 127 def synchronize lock begin yield ensure unlock end end
<code/>
<pre/>
<code/>and<pre/>for code samples.