Skip to content

Commit

Permalink
document expectations for Waker::wake
Browse files Browse the repository at this point in the history
fixes #93961
  • Loading branch information
rkuhn authored Feb 13, 2022
1 parent 1f4681a commit f52ebaa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/core/src/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ unsafe impl Sync for Waker {}

impl Waker {
/// Wake up the task associated with this `Waker`.
///
/// Multiple wake-ups (through clones of this `Waker` or `wake_by_ref`) may be
/// coalesced into a single `poll` invocation by the runtime, and as long as
/// the runtime keeps running and the task is not finished it is expected that
/// each wake-up is followed by an invocation of `poll`, even in the absence of
/// other events. This makes it possible to yield to other tasks when running
/// potentially unbounded processing loops in order to maintain fairness.
#[inline]
#[stable(feature = "futures_api", since = "1.36.0")]
pub fn wake(self) {
Expand Down

0 comments on commit f52ebaa

Please sign in to comment.