Commit 2c8d004f authored by Max Kellermann's avatar Max Kellermann

output/Control: add LockWaitForCommand()

parent 684bd915
......@@ -309,6 +309,11 @@ public:
*/
void WaitForCommand() noexcept;
void LockWaitForCommand() noexcept {
const std::lock_guard<Mutex> protect(mutex);
WaitForCommand();
}
/**
* Sends a command, but does not wait for completion.
*
......
......@@ -158,10 +158,8 @@ MultipleOutputs::EnableDisable()
void
MultipleOutputs::WaitAll() noexcept
{
for (const auto &ao : outputs) {
const std::lock_guard<Mutex> protect(ao->mutex);
ao->WaitForCommand();
}
for (const auto &ao : outputs)
ao->LockWaitForCommand();
}
void
......
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