mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
Keep lock until sender notified (#2302)
This commit is contained in:
parent
bc8dcdeb58
commit
826fc21abf
@ -980,7 +980,7 @@ impl<T> Slot<T> {
|
|||||||
if 1 == self.lock.fetch_sub(2, SeqCst) - 2 {
|
if 1 == self.lock.fetch_sub(2, SeqCst) - 2 {
|
||||||
// First acquire the lock to make sure our sender is waiting on the
|
// First acquire the lock to make sure our sender is waiting on the
|
||||||
// condition variable, otherwise the notification could be lost.
|
// condition variable, otherwise the notification could be lost.
|
||||||
let _ = tail.lock().unwrap();
|
let _lock = tail.lock().unwrap();
|
||||||
// Wake up senders
|
// Wake up senders
|
||||||
condvar.notify_all();
|
condvar.notify_all();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user