diff --git a/src/join_handle.rs b/src/join_handle.rs index d4fed50..63d3501 100644 --- a/src/join_handle.rs +++ b/src/join_handle.rs @@ -206,11 +206,10 @@ impl Future for JoinHandle { // 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); }