output/httpd: wake up the I/O thread only if pages have been read from encoder
This commit is contained in:
parent
72008d951b
commit
452666f742
|
@ -343,13 +343,17 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeferredMonitor::Schedule();
|
if (!empty)
|
||||||
|
DeferredMonitor::Schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
|
Loading…
Reference in New Issue