output/Internal: add method IsBusy()

This commit is contained in:
Max Kellermann 2017-04-18 23:15:46 +02:00
parent 2e4e1c7f48
commit c788c76dc9
2 changed files with 8 additions and 1 deletions

View File

@ -313,6 +313,13 @@ public:
return command == Command::NONE; return command == Command::NONE;
} }
/**
* Caller must lock the mutex.
*/
bool IsBusy() const {
return IsOpen() && !IsCommandFinished();
}
/** /**
* Caller must lock the mutex. * Caller must lock the mutex.
*/ */

View File

@ -138,7 +138,7 @@ MultipleOutputs::AllFinished() const
{ {
for (auto ao : outputs) { for (auto ao : outputs) {
const std::lock_guard<Mutex> protect(ao->mutex); const std::lock_guard<Mutex> protect(ao->mutex);
if (ao->IsOpen() && !ao->IsCommandFinished()) if (ao->IsBusy())
return false; return false;
} }