diff options
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); |