Struct extra::arc::Condvar

pub struct Condvar<'self> {
    priv is_mutex: bool,
    priv failed: &'self mut bool,
    priv cond: &'self Condvar<'self>,
}

As sync::condvar, a mechanism for unlock-and-descheduling and signaling.

Methods

impl<'self> Condvar<'self>

fn wait(&self)

Atomically exit the associated Arc and block until a signal is sent.

fn wait_on(&self, condvar_id: uint)

Atomically exit the associated Arc and block on a specified condvar until a signal is sent on that same condvar (as sync::cond.wait_on).

wait() is equivalent to wait_on(0).

fn signal(&self) -> bool

Wake up a blocked task. Returns false if there was no blocked task.

fn signal_on(&self, condvar_id: uint) -> bool

Wake up a blocked task on a specified condvar (as sync::cond.signal_on). Returns false if there was no blocked task.

fn broadcast(&self) -> uint

Wake up all blocked tasks. Returns the number of tasks woken.

fn broadcast_on(&self, condvar_id: uint) -> uint

Wake up all blocked tasks on a specified condvar (as sync::cond.broadcast_on). Returns the number of tasks woken.