From e417495505281d55710867b9b45a0c8d46d54b70 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 1 Mar 2022 17:18:14 +0100 Subject: [PATCH] Fix possible race (BaseUI creation vs x-thread signal-emission) When a BaseUI is being created, signals can arrive before the _run_loop_thread is running, which can trigger an assert in BaseUI::caller_is_self(). --- libs/pbd/base_ui.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc index 83df2b76b5..6c9a095d6d 100644 --- a/libs/pbd/base_ui.cc +++ b/libs/pbd/base_ui.cc @@ -119,11 +119,12 @@ BaseUI::run () m_context = MainContext::create(); _main_loop = MainLoop::create (m_context); - attach_request_source (); Glib::Threads::Mutex::Lock lm (_run_lock); _run_loop_thread = PBD::Thread::create (boost::bind (&BaseUI::main_thread, this)); _running.wait (_run_lock); + + attach_request_source (); } void