output/Control: add LockWaitForCommand()

This commit is contained in:
Max Kellermann 2019-04-26 18:25:36 +02:00
parent 684bd9153e
commit 2c8d004f78
2 changed files with 7 additions and 4 deletions

View File

@ -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.
*

View File

@ -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