diff options
author | Merry <git@mary.rs> | 2022-04-07 19:30:55 +0100 |
---|---|---|
committer | Merry <git@mary.rs> | 2022-04-07 19:30:55 +0100 |
commit | c589db6adde8e4706065b1ab00bd6814b39dc8bb (patch) | |
tree | 19430d5342df4de9b8fc196012e53b09fb8f5f41 /src/common/host_memory.cpp | |
parent | 4265372099be28590a880859bb0d1af0cb4fef72 (diff) |
common: 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 e829af1acc..802943eb71 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -149,7 +149,7 @@ public: } void Unmap(size_t virtual_offset, size_t length) { - std::lock_guard lock{placeholder_mutex}; + std::scoped_lock lock{placeholder_mutex}; // Unmap until there are no more placeholders while (UnmapOnePlaceholder(virtual_offset, length)) { @@ -169,7 +169,7 @@ public: } const size_t virtual_end = virtual_offset + length; - std::lock_guard lock{placeholder_mutex}; + std::scoped_lock lock{placeholder_mutex}; auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); while (it != end) { const size_t offset = std::max(it->lower(), virtual_offset); |