Skip to content

Commit

Permalink
runtime: move is_join_waker_set assertion in unset_waker (#7072)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored Jan 6, 2025
1 parent 15f7366 commit bd3e857
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tokio/src/runtime/task/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit bd3e857

Please sign in to comment.