output/Control: add LockWaitForCommand()
This commit is contained in:
parent
684bd9153e
commit
2c8d004f78
@ -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()
|
|||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user