diff options
| author | Roland Kuhn <rk@rkuhn.info> | 2022-02-13 17:08:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-13 17:08:30 +0100 |
| commit | f52ebaa45dcb35a7dbb8fcb1a19ad41de02ab581 (patch) | |
| tree | b0b2ffcdb8fec83526586d210afeaaf8da7c4f7f /library/core/src/task | |
| parent | 1f4681ad7a132755452c32a987ad0f0d075aa6aa (diff) | |
| download | rust-f52ebaa45dcb35a7dbb8fcb1a19ad41de02ab581.tar.gz rust-f52ebaa45dcb35a7dbb8fcb1a19ad41de02ab581.zip | |
document expectations for Waker::wake
fixes #93961
Diffstat (limited to 'library/core/src/task')
| -rw-r--r-- | library/core/src/task/wake.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index 27af227a1f2..c3e6c1f84ad 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -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) { |
