Logging: Don't lock the queue for the duration of the write
This commit is contained in:
parent
b30c5370b1
commit
6daebaaa57
1 changed files with 5 additions and 3 deletions
|
@ -83,8 +83,10 @@ private:
|
|||
}
|
||||
};
|
||||
while (true) {
|
||||
std::unique_lock<std::mutex> lock(message_mutex);
|
||||
message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); });
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(message_mutex);
|
||||
message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); });
|
||||
}
|
||||
if (!running) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue