runtime: move is_join_waker_set assertion in unset_waker (#7072)

This commit is contained in:
Alice Ryhl 2025-01-06 22:19:53 +01:00 committed by GitHub
parent 15f73666f1
commit bd3e857737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -446,12 +446,15 @@ impl State {
pub(super) fn unset_waker(&self) -> UpdateResult {
self.fetch_update(|curr| {
assert!(curr.is_join_interested());
assert!(curr.is_join_waker_set());
if curr.is_complete() {
return None;
}
// If the task is completed, this bit may have been unset by
// `unset_waker_after_complete`.
assert!(curr.is_join_waker_set());
let mut next = curr;
next.unset_join_waker();