13
0

make use TempoMap::fetch() in RTproc threads more explicit

This also places the call in a more optimal location, right after it is woken
because there is Route processing to be done
This commit is contained in:
Paul Davis 2022-04-06 13:18:20 -06:00
parent 2f823164ad
commit 9e69c0d184
2 changed files with 7 additions and 10 deletions

View File

@ -140,8 +140,6 @@ private:
/* engine / thread connection */
PBD::ScopedConnectionList engine_connections;
void engine_stopped ();
void setup_thread_local_variables ();
};
} // namespace

View File

@ -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
{