Atomically unlocks a mutex guard and waits for a signal on this condvar.
impl Condvar {
fn wait2<T, U>(&self, mutex: &'a Mutex<T>, guard: MutexGuard<'b, U>) -> MutexGuard<'a, T>
}| Name | Description |
|---|---|
| mutex | The mutex to be locked before returning. |
| guard | The mutex guard to be unlocked. |
Returns a guard created by locking the mutex argument.
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.
The mutex in question in the above paragraph is the mutex passed as the mutex argument. The guard argument doesn't have to be related to the mutex in any way.