File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ use crate::sync::Arc;
3737/// link ../../std/task/struct.Waker.html#impl-From%3CArc%3CW,+Global%3E%3E-for-Waker
3838/// without getting a link-checking error in CI. -->
3939///
40+ /// # Memory Ordering
41+ ///
42+ /// To avoid missed wakeups, all executors must adhere to the requirement described for [`Waker::wake`].
43+ ///
4044/// # Examples
4145///
4246/// A basic `block_on` function that takes a future and runs it to completion on
Original file line number Diff line number Diff line change @@ -418,15 +418,16 @@ unsafe impl Sync for Waker {}
418418impl Waker {
419419 /// Wakes up the task associated with this `Waker`.
420420 ///
421- /// As long as the executor keeps running and the task is not finished, it is
422- /// guaranteed that each invocation of [`wake()`](Self::wake) (or
421+ /// As long as the executor keeps running and the task is not finished,
422+ /// it is guaranteed that each invocation of [`wake()`](Self::wake) (or
423423 /// [`wake_by_ref()`](Self::wake_by_ref)) will be followed by at least one
424- /// [`poll()`] of the task to which this `Waker` belongs. This makes
425- /// it possible to temporarily yield to other tasks while running potentially
426- /// unbounded processing loops.
424+ /// [`poll()`] of the task to which this `Waker` belongs, such that the call to
425+ /// [`wake()`](Self::wake) (or [`wake_by_ref()`](Self::wake_by_ref)) _happens-before_
426+ /// the beginning of the invocation of [`poll()`]. This makes it possible to temporarily
427+ /// yield to other tasks while running potentially unbounded processing loops.
427428 ///
428429 /// Note that the above implies that multiple wake-ups may be coalesced into a
429- /// single [`poll()`] invocation by the runtime .
430+ /// single [`poll()`] invocation by the executor .
430431 ///
431432 /// Also note that yielding to competing tasks is not guaranteed: it is the
432433 /// executor’s choice which task to run and the executor may choose to run the
You can’t perform that action at this time.
0 commit comments