このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

Ruby 2.7.0 リファレンスマニュアル

instance method Monitor#wait_for_cond

wait_for_cond(cond, timeout) -> true[permalink][rdoc]

MonitorMixin::ConditionVariable 用の内部メソッドです。

[PARAM] cond:
Thread::ConditionVariable を指定します。
[PARAM] timeout:
タイムアウトまでの秒数。指定しなかった場合はタイムアウトしません。
[RETURN]
Ruby 1.9 の頃からのバグで常に true を返します。([bug#16608])
require 'monitor'
m = Monitor.new
cv = Thread::ConditionVariable.new
m.enter
m.wait_for_cond(cv, 1)