From 7c0378f56dac012777f6a977acf70111bce91e51 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 27 Sep 2018 16:21:56 +0100 Subject: [PATCH] a64_exclusive_monitor: Loosen memory ordering requirements It is not necessary to be as strict as it was. --- src/backend/x64/a64_exclusive_monitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/x64/a64_exclusive_monitor.cpp b/src/backend/x64/a64_exclusive_monitor.cpp index e0373fde..d3f911bb 100644 --- a/src/backend/x64/a64_exclusive_monitor.cpp +++ b/src/backend/x64/a64_exclusive_monitor.cpp @@ -30,11 +30,11 @@ void ExclusiveMonitor::Mark(size_t processor_id, VAddr address, size_t size) { } void ExclusiveMonitor::Lock() { - while (is_locked.test_and_set()) {} + while (is_locked.test_and_set(std::memory_order_acquire)) {} } void ExclusiveMonitor::Unlock() { - is_locked.clear(); + is_locked.clear(std::memory_order_release); } bool ExclusiveMonitor::CheckAndClear(size_t processor_id, VAddr address, size_t size) {