1. MonitorMixin::
  2. ConditionVariable

class MonitorMixin::ConditionVariable

FIXME: This isn’t documented in Nutshell.

SinceMonitorMixin.new_cond returns aConditionVariable, and the example above calls while_wait and signal, this class should be documented.

Public Instance Methods

Source
# File ext/monitor/lib/monitor.rb, line 139defbroadcast@monitor.mon_check_owner@cond.broadcastend

Wakes up all threads waiting for this lock.

Source
# File ext/monitor/lib/monitor.rb, line 131defsignal@monitor.mon_check_owner@cond.signalend

Wakes up the first thread in line waiting for this lock.

Source
# File ext/monitor/lib/monitor.rb, line 105defwait(timeout =nil)@monitor.mon_check_owner@monitor.wait_for_cond(@cond,timeout)end

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

Iftimeout is given, this method returns aftertimeout seconds passed, even if no other thread doesn’t signal.

Source
# File ext/monitor/lib/monitor.rb, line 122defwait_untiluntilyieldwaitendend

Calls wait repeatedly until the given block yields a truthy value.

Source
# File ext/monitor/lib/monitor.rb, line 113defwait_whilewhileyieldwaitendend

Calls wait repeatedly while the given block yields a truthy value.