output/Control: add LockEnableDisableAsync()
This commit is contained in:
parent
2c8d004f78
commit
4473816384
@ -360,6 +360,12 @@ public:
|
|||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
void EnableDisableAsync();
|
void EnableDisableAsync();
|
||||||
|
|
||||||
|
void LockEnableDisableAsync() {
|
||||||
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
|
EnableDisableAsync();
|
||||||
|
}
|
||||||
|
|
||||||
void LockPauseAsync() noexcept;
|
void LockPauseAsync() noexcept;
|
||||||
|
|
||||||
void CloseWait() noexcept;
|
void CloseWait() noexcept;
|
||||||
|
@ -147,10 +147,8 @@ MultipleOutputs::EnableDisable()
|
|||||||
{
|
{
|
||||||
/* parallel execution */
|
/* parallel execution */
|
||||||
|
|
||||||
for (const auto &ao : outputs) {
|
for (const auto &ao : outputs)
|
||||||
const std::lock_guard<Mutex> lock(ao->mutex);
|
ao->LockEnableDisableAsync();
|
||||||
ao->EnableDisableAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
WaitAll();
|
WaitAll();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user