Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0