triggers/graph: fix location of calls to TempoMap::fetch()

This ensures that RT graph threads have the correct tempo map,
and thus run triggers correctly when timestretch is required.
This commit is contained in:
Paul Davis 2022-10-27 16:33:46 -06:00
parent b195a04281
commit bd33971346

View File

@ -227,6 +227,8 @@ Graph::prep ()
g_atomic_int_inc (&_trigger_queue_size);
_trigger_queue.push_back (i.get ());
}
Temporal::TempoMap::fetch();
}
void
@ -323,8 +325,6 @@ Graph::run_one ()
/* update the thread-local tempo map ptr */
Temporal::TempoMap::fetch ();
if (g_atomic_int_get (&_terminate)) {
return;
}
@ -337,6 +337,8 @@ Graph::run_one ()
_trigger_queue.pop_front (to_run);
}
Temporal::TempoMap::fetch ();
/* Process the graph-node */
g_atomic_int_dec_and_test (&_trigger_queue_size);
to_run->run (_graph_chain);
@ -366,9 +368,6 @@ 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)) {
run_one ();
}
@ -402,7 +401,6 @@ Graph::main_thread ()
/* Wait for initial process callback */
again:
_callback_start_sem.wait ();
Temporal::TempoMap::fetch ();
DEBUG_TRACE (DEBUG::ProcessThreads, "main thread is awake\n");