diff options
| author | 2019-04-01 14:36:24 -0400 | |
|---|---|---|
| committer | 2019-04-01 14:36:24 -0400 | |
| commit | e0eee250bb4d70f4fc4973f08649636faf9808cf (patch) | |
| tree | eaf2aabd5471c13fe89ac5f7da247b3bf1248e83 /src/common/logging/backend.cpp | |
| parent | Merge pull request #2304 from lioncash/memsize (diff) | |
| parent | general: Use deducation guides for std::lock_guard and std::unique_lock (diff) | |
| download | yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.gz yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.tar.xz yuzu-e0eee250bb4d70f4fc4973f08649636faf9808cf.zip | |
Merge pull request #2312 from lioncash/locks
general: Use deducation guides for std::lock_guard and std::unique_lock
Diffstat (limited to 'src/common/logging/backend.cpp')
| -rw-r--r-- | src/common/logging/backend.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 4462ff3fb..a03179520 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -46,12 +46,12 @@ public: | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void AddBackend(std::unique_ptr<Backend> backend) { | 48 | void AddBackend(std::unique_ptr<Backend> backend) { |
| 49 | std::lock_guard<std::mutex> lock(writing_mutex); | 49 | std::lock_guard lock{writing_mutex}; |
| 50 | backends.push_back(std::move(backend)); | 50 | backends.push_back(std::move(backend)); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | void RemoveBackend(std::string_view backend_name) { | 53 | void RemoveBackend(std::string_view backend_name) { |
| 54 | std::lock_guard<std::mutex> lock(writing_mutex); | 54 | std::lock_guard lock{writing_mutex}; |
| 55 | const auto it = | 55 | const auto it = |
| 56 | std::remove_if(backends.begin(), backends.end(), | 56 | std::remove_if(backends.begin(), backends.end(), |
| 57 | [&backend_name](const auto& i) { return backend_name == i->GetName(); }); | 57 | [&backend_name](const auto& i) { return backend_name == i->GetName(); }); |
| @@ -80,7 +80,7 @@ private: | |||
| 80 | backend_thread = std::thread([&] { | 80 | backend_thread = std::thread([&] { |
| 81 | Entry entry; | 81 | Entry entry; |
| 82 | auto write_logs = [&](Entry& e) { | 82 | auto write_logs = [&](Entry& e) { |
| 83 | std::lock_guard<std::mutex> lock(writing_mutex); | 83 | std::lock_guard lock{writing_mutex}; |
| 84 | for (const auto& backend : backends) { | 84 | for (const auto& backend : backends) { |
| 85 | backend->Write(e); | 85 | backend->Write(e); |
| 86 | } | 86 | } |