output/httpd: wake up the I/O thread only if pages have been read from encoder

This commit is contained in:
Max Kellermann 2017-02-19 20:46:20 +01:00
parent 72008d951b
commit 452666f742
1 changed files with 5 additions and 1 deletions

View File

@ -343,12 +343,16 @@ HttpdOutput::BroadcastFromEncoder()
cond.wait(mutex);
}
bool empty = true;
PagePtr page;
while ((page = ReadPage()) != nullptr) {
const std::lock_guard<Mutex> lock(mutex);
pages.push(std::move(page));
empty = false;
}
if (!empty)
DeferredMonitor::Schedule();
}