-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle spurious wakeups #740
Conversation
that handles spurious wakeups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
I've got a couple of suggestions in the text. Feel free to take them or leave them.
Co-authored-by: Hayden Stainsby <hds@caffeineconcepts.com>
} | ||
|
||
fn poll(&mut self, cx: &mut Context<'_>) { | ||
// Spurious wake-ups are allowed, even after a future has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be worth linking to wherever in the std::future
documentation it explains that the future trait contract allows spurious wakeups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure where that's documented, and didn't find anything with a quick search of the obvious candidates. It may be implied by other documentation, or just "common knowledge".
I only became aware of it because @Darksonn commented such on a previous PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hawkw any thoughts on the above 👆? Otherwise this is good to go 🚀
Updates the tutorial to handle spurious wakeups. Continuation from discussion in #739
Playground