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/threadsafe_queue.h | |
| 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 '')
| -rw-r--r-- | src/common/threadsafe_queue.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h index 821e8536a..e714ba5b3 100644 --- a/src/common/threadsafe_queue.h +++ b/src/common/threadsafe_queue.h | |||
| @@ -78,7 +78,7 @@ public: | |||
| 78 | 78 | ||
| 79 | T PopWait() { | 79 | T PopWait() { |
| 80 | if (Empty()) { | 80 | if (Empty()) { |
| 81 | std::unique_lock<std::mutex> lock(cv_mutex); | 81 | std::unique_lock lock{cv_mutex}; |
| 82 | cv.wait(lock, [this]() { return !Empty(); }); | 82 | cv.wait(lock, [this]() { return !Empty(); }); |
| 83 | } | 83 | } |
| 84 | T t; | 84 | T t; |
| @@ -137,7 +137,7 @@ public: | |||
| 137 | 137 | ||
| 138 | template <typename Arg> | 138 | template <typename Arg> |
| 139 | void Push(Arg&& t) { | 139 | void Push(Arg&& t) { |
| 140 | std::lock_guard<std::mutex> lock(write_lock); | 140 | std::lock_guard lock{write_lock}; |
| 141 | spsc_queue.Push(t); | 141 | spsc_queue.Push(t); |
| 142 | } | 142 | } |
| 143 | 143 | ||