Commit 44738163 authored by Max Kellermann's avatar Max Kellermann

output/Control: add LockEnableDisableAsync()

parent 2c8d004f
......@@ -360,6 +360,12 @@ public:
* Caller must lock the mutex.
*/
void EnableDisableAsync();
void LockEnableDisableAsync() {
const std::lock_guard<Mutex> protect(mutex);
EnableDisableAsync();
}
void LockPauseAsync() noexcept;
void CloseWait() noexcept;
......
......@@ -147,10 +147,8 @@ MultipleOutputs::EnableDisable()
{
/* parallel execution */
for (const auto &ao : outputs) {
const std::lock_guard<Mutex> lock(ao->mutex);
ao->EnableDisableAsync();
}
for (const auto &ao : outputs)
ao->LockEnableDisableAsync();
WaitAll();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment