Skip to content

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

instance method

Thread::ConditionVariable#wait

wait(mutex, timeout=nil)

Releases the lock held in mutex 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.

Returns the slept result on mutex.

See also #signal #broadcast also in 3.4 · 3.3 · 3.1