aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/join_handle.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/join_handle.rs b/src/join_handle.rs
index bd9366f..bd6f8c7 100644
--- a/src/join_handle.rs
+++ b/src/join_handle.rs
@@ -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);
}