Expand description
Implements a combined mutex and condition.
§Example:
let condition = Condition::new(0);
condition.when(|state| if state == 1 { Poll::Ready(()) } else { Poll::Pending }).await;
// Elsewhere...
let guard = condition.lock();
*guard.lock() = 1;
for waker in guard.drain_wakers() {
waker.wake();
}
Structs§
- Condition
- An async condition which combines a mutex and a condition variable.
- Condition
Guard - Guard returned by
lock
. - Drainer
- An iterator that will drain waiters.
- Waker
Entry - A waker entry that can be added to a list.