Commit 452666f7 authored by Max Kellermann's avatar Max Kellermann

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

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