Skip to content

remove one notify_unless call #9

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

Merged
3 commits merged into from
Nov 20, 2019
Merged

remove one notify_unless call #9

3 commits merged into from
Nov 20, 2019

Conversation

laizy
Copy link
Contributor

@laizy laizy commented Nov 18, 2019

Header::awaiter can only be changed with Header::swap_awaiter, which only be called in three places.
swap_awaiter(None) in two places, and one in function JoinHandle::poll at line 202. since JoinHandle::poll will not called concurrently, at line 211 we can conclude that Header::awaiter must be cx.waker() (set at line 202) or None(set by other thread). so call notify_unless will have no effects, and can be removed.

@@ -208,9 +208,6 @@ impl<R, T> Future for JoinHandle<R, T> {

// If the task has been closed, notify the awaiter and return `None`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update this comment to reflect the change?

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Co-Authored-By: Stjepan Glavina <stjepang@gmail.com>
@ghost ghost merged commit 2b0427a into async-rs:master Nov 20, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant