summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/logging/backend.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 242914c6a..5313b8510 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -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;
}
@@ -282,4 +284,4 @@ void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename,
Impl::Instance().PushEntry(std::move(entry));
}
-} // namespace Log \ No newline at end of file
+} // namespace Log