output/httpd: no mutex lock while reading data from encoder

This commit is contained in:
Max Kellermann 2017-02-19 20:45:16 +01:00
parent 72146e7800
commit 72008d951b

View File

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