Skip to content

Commit

Permalink
fix iterate in close_and_shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
wathenjiang committed Sep 13, 2023
1 parent 6453017 commit 9bfb4f1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tokio/src/runtime/task/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,10 @@ impl<S: 'static> OwnedTasks<S> {
self.closed.fetch_and(true, Ordering::Release);

for i in 0..self.lists.len() {
let first_task = self.pop_back_inner(i);
match first_task {
Some(task) => task.shutdown(),
None => return,
}
loop {
let task = match self.pop_back_inner(i) {
Some(task) => task,
None => return,
None => continue,
};
task.shutdown();
}
Expand Down

0 comments on commit 9bfb4f1

Please sign in to comment.