diff options
author | th0114nd <1399455+th0114nd@users.noreply.github.com> | 2020-03-08 23:46:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 20:46:19 -0700 |
commit | 826fc21abfd04779cde92e4cc33de2adb42cf327 (patch) | |
tree | 2991ca5cfd8f60e203f35bd73235f2e54db641e5 /tokio/src/sync/broadcast.rs | |
parent | bc8dcdeb58dfca234d85b2a93a7a20af738f48a2 (diff) |
Keep lock until sender notified (#2302)
Diffstat (limited to 'tokio/src/sync/broadcast.rs')
-rw-r--r-- | tokio/src/sync/broadcast.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/sync/broadcast.rs b/tokio/src/sync/broadcast.rs index 515e4e4d..3bf7e54e 100644 --- a/tokio/src/sync/broadcast.rs +++ b/tokio/src/sync/broadcast.rs @@ -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(); } |