diff options
| author | 2022-04-08 14:01:42 -0700 | |
|---|---|---|
| committer | 2022-04-08 14:01:42 -0700 | |
| commit | 04efd729d6b86b133d1ccacfcab77235e247f766 (patch) | |
| tree | 2a896020311d81e739adf0d2803d589f88ece313 /src/common/threadsafe_queue.h | |
| parent | Merge pull request #8173 from Morph1984/msvc-warn-unused-fn (diff) | |
| parent | core/hle: Standardize scoped_lock initializers (diff) | |
| download | yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.gz yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.tar.xz yuzu-04efd729d6b86b133d1ccacfcab77235e247f766.zip | |
Merge pull request #8169 from merryhime/scoped_lock
Replace lock_guard with scoped_lock
Diffstat (limited to 'src/common/threadsafe_queue.h')
| -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 2c8c2b90e..7272ac6e8 100644 --- a/src/common/threadsafe_queue.h +++ b/src/common/threadsafe_queue.h | |||
| @@ -52,7 +52,7 @@ public: | |||
| 52 | // line before cv.wait | 52 | // line before cv.wait |
| 53 | // TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported. | 53 | // TODO(bunnei): This can be replaced with C++20 waitable atomics when properly supported. |
| 54 | // See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details. | 54 | // See discussion on https://github.com/yuzu-emu/yuzu/pull/3173 for details. |
| 55 | std::lock_guard lock{cv_mutex}; | 55 | std::scoped_lock lock{cv_mutex}; |
| 56 | cv.notify_one(); | 56 | cv.notify_one(); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -159,7 +159,7 @@ public: | |||
| 159 | 159 | ||
| 160 | template <typename Arg> | 160 | template <typename Arg> |
| 161 | void Push(Arg&& t) { | 161 | void Push(Arg&& t) { |
| 162 | std::lock_guard lock{write_lock}; | 162 | std::scoped_lock lock{write_lock}; |
| 163 | spsc_queue.Push(t); | 163 | spsc_queue.Push(t); |
| 164 | } | 164 | } |
| 165 | 165 | ||