Browse Source

Logging: Don't lock the queue for the duration of the write

nce_cpp
James Rowe 8 years ago
parent
commit
ada0d38ca9
  1. 2
      src/common/logging/backend.cpp

2
src/common/logging/backend.cpp

@ -83,8 +83,10 @@ private:
} }
}; };
while (true) { while (true) {
{
std::unique_lock<std::mutex> lock(message_mutex); std::unique_lock<std::mutex> lock(message_mutex);
message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); }); message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); });
}
if (!running) { if (!running) {
break; break;
} }

Loading…
Cancel
Save