Skip to content

Commit

Permalink
Keep lock until sender notified (#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
th0114nd committed Mar 9, 2020
1 parent bc8dcde commit 826fc21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tokio/src/sync/broadcast.rs
Expand Up @@ -980,7 +980,7 @@ impl<T> Slot<T> {
if 1 == self.lock.fetch_sub(2, SeqCst) - 2 {
// First acquire the lock to make sure our sender is waiting on the
// condition variable, otherwise the notification could be lost.
let _ = tail.lock().unwrap();
let _lock = tail.lock().unwrap();
// Wake up senders
condvar.notify_all();
}
Expand Down

0 comments on commit 826fc21

Please sign in to comment.