pub fn wait_until_registered<F, L, R, G, H>(
condition: F,
acquire: L,
register: R,
) -> boolwhere
F: Fn() -> bool,
L: FnMut() -> G,
R: FnMut(&mut G, WaitQueueWakeToken) -> WaitQueueRegistration<H>,Expand description
Blocks until condition is true while publishing one exact wake token.
register runs after the scheduler park exists, but before the park is
acquire must return the external queue lock that protects condition and
waiter publication. The lock is held while the scheduler park is prepared
and register publishes the token, then released before the park commits.
This is the Linux waitqueue order: a contending rtmutex can sleep while the
caller is still Running, while the lock closes the predicate-to-enqueue
race before Parking becomes visible.
The returned registration lease keeps the token in the caller’s sole ordered source until this attempt resumes or is cancelled. No second internal task queue owns the same waiter.
Returns whether at least one registered token was selected while this call waited. Callers may use that result to continue Linux-style exclusive handoff when the condition remains consumable.