Skip to content

Commit

Permalink
Update tokio/src/runtime/task/list.rs
Browse files Browse the repository at this point in the history
Nice suggestion.

Co-authored-by: Eliza Weisman <[email protected]>
  • Loading branch information
wathenjiang and hawkw authored Sep 24, 2023
1 parent d2c7668 commit 7514821
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tokio/src/runtime/task/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,8 @@ impl<S: 'static> OwnedTasks<S> {
{
self.closed.store(true, Ordering::Release);
for i in start..self.segment_size as usize + start {
loop {
let mut lock = self.segment_inner(i);
let task = match lock.pop_back() {
Some(task) => {
drop(lock);
self.count.fetch_sub(1, Ordering::Relaxed);
task
}
None => break,
};
while let Some(task) = self.segment_inner(i).pop_back() {
self.count.fetch_sub(1, Ordering::Relaxed);
task.shutdown();
}
}
Expand Down

0 comments on commit 7514821

Please sign in to comment.