Ruby 1.8.7 Reference Manual > All Libraries > library thread > class Mutex > synchronize

instance method Mutex#synchronize

synchronize { ... } -> object

mutex をロックし、ブロックを実行します。実行後に必ず mutex のロックを解放します。

ブロックが最後に評価した値を返します。