output/MultipleOutputs: parallelize EnableDisable()

This commit is contained in:
Max Kellermann
2016-12-14 08:41:22 +01:00
parent 6425b4f9f5
commit 7e1b53480e
3 changed files with 20 additions and 13 deletions

View File

@@ -323,34 +323,34 @@ public:
void LockCommandWait(Command cmd);
/**
* Enables the device.
* Enables the device, but don't wait for completion.
*
* Caller must lock the mutex.
*/
void EnableWait();
void EnableAsync();
/**
* Disables the device.
* Disables the device, but don't wait for completion.
*
* Caller must lock the mutex.
*/
void DisableWait();
void DisableAsync();
/**
* Attempt to enable or disable the device as specified by the
* #enabled attribute; attempt to sync it with #really_enabled
* (wrapper for EnableWait() or DisableWait()).
* (wrapper for EnableAsync() or DisableAsync()).
*
* Caller must lock the mutex.
*/
void EnableDisableWait() {
void EnableDisableAsync() {
if (enabled == really_enabled)
return;
if (enabled)
EnableWait();
EnableAsync();
else
DisableWait();
DisableAsync();
}
void LockPauseAsync();