diff options
| author | 2018-07-14 11:57:13 -0600 | |
|---|---|---|
| committer | 2018-07-14 11:57:13 -0600 | |
| commit | 6daebaaa5798ec7e104ac7a2221b1310a0ba0116 (patch) | |
| tree | 29ed68ebb6cf2b2da1a14f922167b71dda624c14 | |
| parent | yuzu - Fix duplicate logs (diff) | |
| download | yuzu-6daebaaa5798ec7e104ac7a2221b1310a0ba0116.tar.gz yuzu-6daebaaa5798ec7e104ac7a2221b1310a0ba0116.tar.xz yuzu-6daebaaa5798ec7e104ac7a2221b1310a0ba0116.zip | |
Logging: Don't lock the queue for the duration of the write
Diffstat (limited to '')
| -rw-r--r-- | src/common/logging/backend.cpp | 8 |
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: | |||
| 83 | } | 83 | } |
| 84 | }; | 84 | }; |
| 85 | while (true) { | 85 | while (true) { |
| 86 | std::unique_lock<std::mutex> lock(message_mutex); | 86 | { |
| 87 | message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); }); | 87 | std::unique_lock<std::mutex> lock(message_mutex); |
| 88 | message_cv.wait(lock, [&] { return !running || message_queue.Pop(entry); }); | ||
| 89 | } | ||
| 88 | if (!running) { | 90 | if (!running) { |
| 89 | break; | 91 | break; |
| 90 | } | 92 | } |
| @@ -282,4 +284,4 @@ void FmtLogMessageImpl(Class log_class, Level log_level, const char* filename, | |||
| 282 | 284 | ||
| 283 | Impl::Instance().PushEntry(std::move(entry)); | 285 | Impl::Instance().PushEntry(std::move(entry)); |
| 284 | } | 286 | } |
| 285 | } // namespace Log \ No newline at end of file | 287 | } // namespace Log |