Ruby 2.1.0 リファレンスマニュアル > ライブラリ一覧 > monitorライブラリ > Monitorクラス > exit
exit -> ()
[permalink][rdoc]MonitorMixin#mon_exit の別名です。
enter でロックした回数だけ exit を呼ばなければモニターは解放されません。
モニターが解放されればモニターのロック待ちになっていたスレッドが一つ実行を再開します。
require 'monitor'
mon = Monitor.new
mon.enter
mon.enter
mon.exit
mon.exit
mon.exit # => current thread not owner (ThreadError)