pub struct Mutex { priv sem: Sem<~[WaitQueue]>, }
Mutexes A blocking, bounded-waiting, mutual exclusion lock with an associated FIFO condition variable.
A task which fails while holding a mutex will unlock the mutex as it unwinds.
impl Mutex
fn new() -> Mutex
Create a new mutex, with one associated condvar.
fn new_with_condvars(num_condvars: uint) -> Mutex
Create a new mutex, with a specified number of associated condvars. This will allow calling wait_on/signal_on/broadcast_on with condvar IDs between 0 and num_condvars-1. (If num_condvars is 0, lock_cond will be allowed but any operations on the condvar will fail.)
fn lock<U>(&self, blk: &fn() -> U) -> U
Run a function with ownership of the mutex.
fn lock_cond<U>(&self, blk: &fn(c: &Condvar) -> U) -> U
Run a function with ownership of the mutex and a handle to a condvar.
impl std::clone::Clone for Mutex
fn clone(&self) -> Mutex
Create a new handle to the mutex.
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).