Commit 0211c7f7 authored by Max Kellermann's avatar Max Kellermann

lib/yajl/ParseInputStream: use InputStream::LockRead() to reduce lock duration

parent 59139941
......@@ -25,11 +25,9 @@
void
Yajl::ParseInputStream(Handle &handle, InputStream &is)
{
const std::lock_guard<Mutex> protect(is.mutex);
while (true) {
unsigned char buffer[4096];
const size_t nbytes = is.Read(buffer, sizeof(buffer));
const size_t nbytes = is.LockRead(buffer, sizeof(buffer));
if (nbytes == 0)
break;
......
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