Commit c788c76d authored by Max Kellermann's avatar Max Kellermann

output/Internal: add method IsBusy()

parent 2e4e1c7f
...@@ -316,6 +316,13 @@ public: ...@@ -316,6 +316,13 @@ public:
/** /**
* Caller must lock the mutex. * Caller must lock the mutex.
*/ */
bool IsBusy() const {
return IsOpen() && !IsCommandFinished();
}
/**
* Caller must lock the mutex.
*/
const std::exception_ptr &GetLastError() const { const std::exception_ptr &GetLastError() const {
return last_error; return last_error;
} }
......
...@@ -138,7 +138,7 @@ MultipleOutputs::AllFinished() const ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment