From 395ef40fc9e2be22d87d6468c621960a65dd9230 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 5160f2b2..cb1eced6 100644 --- a/utils/livesync/src/livesync/imp.rs +++ b/utils/livesync/src/livesync/imp.rs @@ -1078,6 +1078,7 @@ impl LiveSync { None } else { state.buffer_queued = false; + self.cond.notify_all(); Some((buffer, lateness)) } } @@ -1142,7 +1143,6 @@ impl LiveSync { segment = state.pending_segment.take(); duplicate = lateness != BufferLateness::OnTime; - self.cond.notify_all(); } None => { // Work around borrow checker