class MonitorMixin::ConditionVariable
FIXME: This isnโt documented in Nutshell.
Since MonitorMixin.new_cond returns a ConditionVariable, and the example above calls while_wait and signal, this class should be documented.
Public Class Methods
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/monitor/0/monitor.rbs, line 317
def broadcast: () -> Thread::ConditionVariable
Wakes up all threads waiting for this lock.
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/monitor/0/monitor.rbs, line 325
def signal: () -> Thread::ConditionVariable
Wakes up the first thread in line waiting for this lock.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/monitor/0/monitor.rbs, line 337
def wait: (?Numeric? timeout) -> untyped
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.
() { () → boolish } → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/monitor/0/monitor.rbs, line 345
def wait_until: () { () -> boolish } -> untyped
Calls wait repeatedly until the given block yields a truthy value.
() { () → boolish } → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/monitor/0/monitor.rbs, line 353
def wait_while: () { () -> boolish } -> untyped
Calls wait repeatedly while the given block yields a truthy value.