Method lrs::sync::Condvar::wait

Atomically unlocks a mutex guard and waits for a signal on this condvar before re-locking the mutex.

Syntax

impl Condvar {
    fn wait<T>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T>
}

Arguments

NameDescription
guard

The mutex guard to be unlocked.

Return value

Returns a guard created by re-locking the mutex of the guard argument.

Remarks

While the condition variable is in use, the condition variable can only be used with the same mutex. The condition variable is in use while there are users waiting on it. If the condition variable is used with another a mutex, the process is aborted.