Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

MonitorMixin::ConditionVariable#wait

wait(timeout = nil)

Releases the lock held in the associated monitor and waits; reacquires the lock on wakeup.

If timeout is given, this method returns after timeout seconds passed, even if no other thread doesn’t signal.

See also #signal #wait_until #broadcast #wait_while also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1