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
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/join_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ impl<R, T> Future for JoinHandle<R, T> {
// completed or closed just before registration so we need to check for that.
state = (*header).state.load(Ordering::Acquire);

// If the task has been closed, notify the awaiter and return `None`.
// If the task has been closed, return `None`. We do not need to notify the
// awaiter here, since we have replaced the waker above, and the executor can
// only set it back to None.
if state & CLOSED != 0 {
// Even though the awaiter is most likely the current task, it could also
// be another task.
(*header).notify_unless(cx.waker());
return Poll::Ready(None);
}

Expand Down