aboutsummaryrefslogtreecommitdiff
path: root/src/common/host_memory.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-04-08 14:01:42 -0700
committerGitHub <noreply@github.com>2022-04-08 14:01:42 -0700
commit27e7b14429e5267de209d964a4ed7e47c2c01844 (patch)
tree2a896020311d81e739adf0d2803d589f88ece313 /src/common/host_memory.cpp
parent3c0470bfb264c3b92900bcc5777da816d15b60b5 (diff)
parent9144a342ca04b3f48293ae1b4987c997aa5c2e41 (diff)
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.cpp4
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);