From c15e6fd7db449754c2f6cb81e40d76f0f05570bc Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 13 Jun 2021 18:35:09 -0600 Subject: [PATCH] fix condition-variable race caused by not holding the request lock when signalling the var --- libs/ardour/butler.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 0600d44615..8d70f2d537 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -225,6 +225,8 @@ Butler::thread_work () so do not bother with buffer refills at this time. */ + std::cerr << "new locate detected in restart, lock and signal\n"; + Glib::Threads::Mutex::Lock lm (request_lock); DEBUG_TRACE (DEBUG::Butler, string_compose ("\tlocate pending, so just pause @ %1 till woken again\n", g_get_monotonic_time())); paused.signal (); continue; @@ -474,6 +476,7 @@ Butler::wait_until_finished () DEBUG_TRACE (DEBUG::Butler, string_compose ("%1: waiting for butler to finish @ %2\n", DEBUG_THREAD_SELF, g_get_monotonic_time())); queue_request (Request::Pause); paused.wait(request_lock); + std::cerr << "wait till finished is back\n"; } bool