Skip to main content

lock_within

Function lock_within 

Source
pub fn lock_within<'m, T: ?Sized>(
    mutex: &'m Mutex<T>,
    what: &'static str,
    patience: Duration,
) -> Result<MutexGuard<'m, T>, LockError>
Expand description

Lock mutex, which guards what, waiting at most patience while another holder keeps it: lock with a patience of its own, for tests.

ยงErrors

A LockError that names what when the lock stays held for patience.