Struct priomutex::reservable::Mutex
[−]
[src]
pub struct Mutex<T: ?Sized> { /* fields omitted */ }
A mutex with no blocking support, but the ability to reserve the lock for another thread.
Methods
impl<T> Mutex<T>
[src]
impl<T: ?Sized> Mutex<T>
[src]
fn try_lock(&self) -> Option<MutexGuard<T>>
[src]
Attempts to acquire this lock. If the lock is free, or has been assigned to this thread by the last holder, then the lock will be acquired.
If the lock could not be acquired at this time, then None is returned. Otherwise, an RAII guard is returned. The lock will be unlocked when the guard is dropped.
This function does not block.
fn into_inner(self) -> T where
T: Sized,
[src]
T: Sized,
Consumes this mutex, returning the underlying data.
fn get_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the underlying data.
Since this call borrows the Mutex
mutably, no actual locking needs to take place---the
mutable borrow statically guarantees no locks exist.