Skip to content

Commit

Permalink
Fix channel dec logic
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Sep 13, 2016
1 parent 68aaf8b commit 0d3e9ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ impl ReceiverCtl {
// Decrement
let second = self.inner.pending.fetch_sub(1, Ordering::AcqRel);

if first == 1 && second > 0 {
if first == 1 && second > 1 {
// There are still pending messages. Since readiness was
// previously unset, it must be reset here
if let Some(set_readiness) = self.inner.set_readiness.borrow() {
try!(set_readiness.set_readiness(Ready::none()));
try!(set_readiness.set_readiness(Ready::readable()));
}
}

Expand Down

0 comments on commit 0d3e9ea

Please sign in to comment.