Skip to content

Commit

Permalink
sync: fix mpsc bug related to closing the channel
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Dec 4, 2020
1 parent c63057e commit 4932e35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tokio/src/sync/semaphore_ll.rs
Expand Up @@ -917,6 +917,10 @@ impl Waiter {
let mut curr = WaiterState(self.state.load(Acquire));

loop {
if curr.is_closed() {
return 0;
}

if !curr.is_queued() {
assert_eq!(0, curr.permits_to_acquire());
}
Expand Down

0 comments on commit 4932e35

Please sign in to comment.