Trait parking_method::MutexMethod
source · [−]pub trait MutexMethod<'a, V> {
fn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>;
}
Expand description
Trait for implementing read/write flavors on Mutex. Note that there are no Recursive locks in Mutex, use ReentrantMutex for that.
Required Methods
fn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>
fn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>
Obtain a lock on a mutex. Blocking locks are infallible and always return a ‘Some()’ variant.