Struct priomutex::Mutex
[−]
[src]
pub struct Mutex<T> { /* fields omitted */ }
A mutex which allows waiting threads to specify a priority.
Methods
impl<T> Mutex<T>
[src]
fn new(data: T) -> Mutex<T>
[src]
Creates a new mutex in an unlocked state ready for use.
fn lock(&self, prio: usize) -> MutexGuard<T>
[src]
Takes the lock. If another thread is holding it, this function will block until the lock is released.
Waiting threads are woken up in order of priority. 0 is the highest priority, 1 is second-highest, etc.
fn try_lock(&self) -> Option<MutexGuard<T>>
[src]
Attempts to take the lock. If another thread is holding it, this function returns None
.