From 1740a8e36314a0c8b2458c1eec19127d944669af Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Wed, 25 Oct 2023 00:18:03 +0200 Subject: [PATCH] livesync: Move a notify closer to the interesting state change Move the `notify_all` to where we pop the buffer. We're moving within a single state lock so no change in behavior. Part-of: --- utils/livesync/src/livesync/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/livesync/src/livesync/imp.rs b/utils/livesync/src/livesync/imp.rs index 25fadaf7..169d6102 100644 --- a/utils/livesync/src/livesync/imp.rs +++ b/utils/livesync/src/livesync/imp.rs @@ -1074,6 +1074,7 @@ impl LiveSync { None } else { state.buffer_queued = false; + self.cond.notify_all(); Some((buffer, lateness)) } } @@ -1138,7 +1139,6 @@ impl LiveSync { segment = state.pending_segment.take(); duplicate = lateness != BufferLateness::OnTime; - self.cond.notify_all(); } None => { // Work around borrow checker