mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 22:26:29 +01:00
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:
parent
9c9f1dbf82
commit
66a3d727cd
1 changed files with 13 additions and 5 deletions
|
|
@ -144,29 +144,37 @@ void
|
||||||
RTTaskList::process (TaskList const& tl)
|
RTTaskList::process (TaskList const& tl)
|
||||||
{
|
{
|
||||||
Glib::Threads::Mutex::Lock pm (_process_mutex);
|
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);
|
Glib::Threads::Mutex::Lock tm (_tasklist_mutex, Glib::Threads::NOT_LOCK);
|
||||||
|
|
||||||
tm.acquire ();
|
tm.acquire ();
|
||||||
_tasklist = tl;
|
assert (_tasklist.empty ());
|
||||||
tm.release ();
|
tm.release ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_tasklist = tl;
|
||||||
process_tasklist ();
|
process_tasklist ();
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
/* ensure that all tasks are processed, and threads are in wait state */
|
||||||
tm.acquire ();
|
tm.acquire ();
|
||||||
_tasklist.clear ();
|
assert (_tasklist.empty ());
|
||||||
tm.release ();
|
tm.release ();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RTTaskList::process_tasklist ()
|
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) {
|
for (TaskList::iterator i = _tasklist.begin (); i != _tasklist.end(); ++i) {
|
||||||
(*i)();
|
(*i)();
|
||||||
}
|
}
|
||||||
|
_tasklist.clear ();
|
||||||
return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
uint32_t nt = std::min (_threads.size (), _tasklist.size ());
|
uint32_t nt = std::min (_threads.size (), _tasklist.size ());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue