diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h index 796f2bdf48..641671017e 100644 --- a/libs/ardour/ardour/graph.h +++ b/libs/ardour/ardour/graph.h @@ -140,8 +140,6 @@ private: /* engine / thread connection */ PBD::ScopedConnectionList engine_connections; void engine_stopped (); - - void setup_thread_local_variables (); }; } // namespace diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index aee1cdf079..bf7c41e437 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -454,6 +454,10 @@ Graph::run_one () DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("%1 goes to sleep\n", pthread_name ())); _execution_sem.wait (); + /* update the thread-local tempo map ptr */ + + Temporal::TempoMap::fetch (); + if (g_atomic_int_get (&_terminate)) { return; } @@ -495,8 +499,10 @@ Graph::helper_thread () pt->get_buffers (); + /* just in case we need the thread local tempo map ptr before anything else */ + Temporal::TempoMap::fetch (); + while (!g_atomic_int_get (&_terminate)) { - setup_thread_local_variables (); run_one (); } @@ -550,7 +556,6 @@ again: /* After setup, the main-thread just becomes a normal worker */ while (!g_atomic_int_get (&_terminate)) { - setup_thread_local_variables (); run_one (); } @@ -558,12 +563,6 @@ again: delete (pt); } -void -Graph::setup_thread_local_variables () -{ - Temporal::TempoMap::fetch (); -} - void Graph::dump (int chain) const {