Skip to main content

mutex_lock

Function mutex_lock 

Source
pub fn mutex_lock<'a, T: ?Sized>(
    lock: &'a Mutex<T>,
    context: &'static str,
) -> Result<MutexGuard<'a, T>, LaneError>
Expand description

Locks a Mutex<T>, mapping poisoning to LaneError::LockPoisoned.

let guard = mutex_lock(&shared, "my-lane.shared")?;