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

output/Control: add LockWaitForCommand()

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