diff options
Diffstat (limited to 'src/common/host_memory.cpp')
-rw-r--r-- | src/common/host_memory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index c465cfc14..802943eb7 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -18,6 +18,7 @@ #include <fcntl.h> #include <sys/mman.h> #include <unistd.h> +#include "common/scope_exit.h" #endif // ^^^ Linux ^^^ @@ -27,7 +28,6 @@ #include "common/assert.h" #include "common/host_memory.h" #include "common/logging/log.h" -#include "common/scope_exit.h" namespace Common { @@ -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); |