From 31b4bc916654b678fdcc3cdea0804125a8fd023f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 4 Jul 2019 22:22:27 +0200 Subject: [PATCH] Delay headless startup, allow background threads to start --- headless/load_session.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/headless/load_session.cc b/headless/load_session.cc index 8551b4a4d5..bcd407f3c8 100644 --- a/headless/load_session.cc +++ b/headless/load_session.cc @@ -239,6 +239,16 @@ int main (int argc, char* argv[]) exit (EXIT_FAILURE); } + /* allow signal propagation, callback/thread-pool setup, etc + * similar to to GUI "first idle" + */ + Glib::usleep (1000000); // 1 sec + + if (!s) { + cerr << "failed_to load session\n"; + exit (EXIT_FAILURE); + } + PBD::ScopedConnectionList con; BasicUI::AccessAction.connect_same_thread (con, boost::bind (&access_action, _1, _2)); AudioEngine::instance()->Halted.connect_same_thread (con, boost::bind (&engine_halted, _1));