Trait namedlock::ownedmutexguard::OwnedMutex [] [src]

pub unsafe trait OwnedMutex<T>: Sized + Deref<Target=Mutex<T>> {
    fn owned_lock<'a>(self) -> Result<OwnedMutexGuard<'a, T, Self>> where Self: 'a { ... }
}

Implements the functions to obtain OwnedMutexGuards.

This trait must only be implemented for types for which the memory address of the value reachable via Deref remains identical even if self gets moved.

Provided Methods

fn owned_lock<'a>(self) -> Result<OwnedMutexGuard<'a, T, Self>> where Self: 'a

Acquires an OwnedMutex, blocking the current thread until it is able to do so.

This function will block the local thread until it is available to acquire the mutex. Upon returning, the thread is the only thread with the mutex held. An RAII guard is returned to allow scoped unlock of the lock. When the guard goes out of scope, the mutex will be unlocked, and the OwnedMutex will be dropped.

Implementors