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/host_memory.cpp | |
| 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/host_memory.cpp')
| -rw-r--r-- | src/common/host_memory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index e829af1ac..802943eb7 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp | |||
| @@ -149,7 +149,7 @@ public: | |||
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | void Unmap(size_t virtual_offset, size_t length) { | 151 | void Unmap(size_t virtual_offset, size_t length) { |
| 152 | std::lock_guard lock{placeholder_mutex}; | 152 | std::scoped_lock lock{placeholder_mutex}; |
| 153 | 153 | ||
| 154 | // Unmap until there are no more placeholders | 154 | // Unmap until there are no more placeholders |
| 155 | while (UnmapOnePlaceholder(virtual_offset, length)) { | 155 | while (UnmapOnePlaceholder(virtual_offset, length)) { |
| @@ -169,7 +169,7 @@ public: | |||
| 169 | } | 169 | } |
| 170 | const size_t virtual_end = virtual_offset + length; | 170 | const size_t virtual_end = virtual_offset + length; |
| 171 | 171 | ||
| 172 | std::lock_guard lock{placeholder_mutex}; | 172 | std::scoped_lock lock{placeholder_mutex}; |
| 173 | auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); | 173 | auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); |
| 174 | while (it != end) { | 174 | while (it != end) { |
| 175 | const size_t offset = std::max(it->lower(), virtual_offset); | 175 | const size_t offset = std::max(it->lower(), virtual_offset); |