Process rt-tasks (resample ports) in parallel (again).

This was changed to single-thread execution in
in bd229936ec
and likely accidentally committed.
This commit is contained in:
Robin Gareus 2022-03-31 21:50:27 +02:00
parent 9c9f1dbf82
commit 66a3d727cd
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -144,29 +144,37 @@ void
RTTaskList::process (TaskList const& tl)
{
Glib::Threads::Mutex::Lock pm (_process_mutex);
#ifndef NDEBUG
/* must not be called while processing is already running */
Glib::Threads::Mutex::Lock tm (_tasklist_mutex, Glib::Threads::NOT_LOCK);
tm.acquire ();
_tasklist = tl;
assert (_tasklist.empty ());
tm.release ();
#endif
_tasklist = tl;
process_tasklist ();
#ifndef NDEBUG
/* ensure that all tasks are processed, and threads are in wait state */
tm.acquire ();
_tasklist.clear ();
assert (_tasklist.empty ());
tm.release ();
#endif
}
void
RTTaskList::process_tasklist ()
{
// if (0 == g_atomic_int_get (&_threads_active) || _threads.size () == 0) {
if (0 == g_atomic_int_get (&_threads_active) || _threads.size () == 0) {
for (TaskList::iterator i = _tasklist.begin (); i != _tasklist.end(); ++i) {
(*i)();
}
_tasklist.clear ();
return;
// }
}
uint32_t nt = std::min (_threads.size (), _tasklist.size ());