Skip to content

Commit 2b0427a

Browse files
laizyStjepan Glavina
and
Stjepan Glavina
committed
remove one notify_unless call (#9)
* remove one notify_unless call * update comments * Update src/join_handle.rs Co-Authored-By: Stjepan Glavina <stjepang@gmail.com>
1 parent 5c398cf commit 2b0427a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/join_handle.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ impl<R, T> Future for JoinHandle<R, T> {
206206
// completed or closed just before registration so we need to check for that.
207207
state = (*header).state.load(Ordering::Acquire);
208208

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

0 commit comments

Comments
 (0)