task: avoid replacing the JoinQueue waker in try_join_next (#8279)

Do not poll pending join handles with a noop waker, since that can replace the waker registered by poll_join_next and leave its caller asleep.
This commit is contained in:
Minh Vu
2026-07-16 13:15:11 +02:00
committed by GitHub
parent 88212ab64a
commit 5e16ee00fa
2 changed files with 61 additions and 0 deletions
+4
View File
@@ -188,6 +188,10 @@ impl<T> JoinQueue<T> {
/// Note that on success the handle will panic on subsequent polls
/// since it becomes consumed.
fn try_poll_handle(jh: &mut AbortOnDropHandle<T>) -> Option<Result<T, JoinError>> {
if !jh.is_finished() {
return None;
}
let waker = futures_util::task::noop_waker();
let mut cx = Context::from_waker(&waker);