Method lrs::sync::RawCondvar::wait2

Atomically unlocks a lock guard and waits for a signal on this condvar.

Syntax

impl RawCondvar {
    fn wait2(&self, lock: &'a Lock, guard: LockGuard<'b>) -> LockGuard<'a>
}

Arguments

NameDescription
lock

The lock to be locked before returning.

guard

The lock guard to be unlocked.

Return value

Returns a guard created by locking the lock argument.

Remarks

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

The lock in question in the above paragraph is the lock passed as the lock argument. The guard argument doesn't have to be related to the lock in any way.