Struct priomutex::spin_one::Mutex
[−]
[src]
pub struct Mutex<T> { /* fields omitted */ }
A mutex which allows waiting threads to specify a priority.
Methods
impl<T> Mutex<T>
[src]
pub fn new(data: T) -> Mutex<T>
[src]
Creates a new mutex in an unlocked state ready for use.
pub fn lock(&self, prio: usize) -> LockResult<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.
pub fn try_lock(&self) -> TryLockResult<MutexGuard<T>>
[src]
Attempts to take the lock. Fails if another thread it already holding it, or is another thread is already waiting to take it.