From 3a4e7d45f1b2dfc1a47c00679e99c2034861e73a Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 23 Dec 2023 14:25:51 -0500 Subject: core_timing: block advance thread while clearing and signal after --- src/core/core_timing.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index c85590d4c..fc536413b 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -72,8 +72,9 @@ void CoreTiming::Initialize(std::function&& on_thread_init_) { } void CoreTiming::ClearPendingEvents() { - std::scoped_lock lock{basic_lock}; + std::scoped_lock lock{advance_lock, basic_lock}; event_queue.clear(); + event.Set(); } void CoreTiming::Pause(bool is_paused) { -- cgit v1.2.3