summaryrefslogtreecommitdiff
path: root/Kernel/Lock.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-01-03 16:58:50 -0700
committerAndreas Kling <kling@serenityos.org>2021-01-04 19:13:52 +0100
commit901ef3f1c87d15d2140be8a880250d09286e10a1 (patch)
tree2a8104d378a30cc5b23d61c13c65872c3ea0b6c2 /Kernel/Lock.h
parentfb84f0ec9c4d5e1a810dc05965ddbec7ff5d99ec (diff)
downloadserenity-901ef3f1c87d15d2140be8a880250d09286e10a1.zip
Kernel: Specify default memory order for some non-synchronizing Atomics
Diffstat (limited to 'Kernel/Lock.h')
-rw-r--r--Kernel/Lock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Lock.h b/Kernel/Lock.h
index 85a0ad08b4..4d5e8bd6f9 100644
--- a/Kernel/Lock.h
+++ b/Kernel/Lock.h
@@ -58,7 +58,7 @@ public:
void unlock();
[[nodiscard]] Mode force_unlock_if_locked(u32&);
void restore_lock(Mode, u32);
- bool is_locked() const { return m_mode.load(AK::MemoryOrder::memory_order_relaxed) != Mode::Unlocked; }
+ bool is_locked() const { return m_mode != Mode::Unlocked; }
void clear_waiters();
const char* name() const { return m_name; }
@@ -81,7 +81,7 @@ private:
Atomic<bool> m_lock { false };
const char* m_name { nullptr };
WaitQueue m_queue;
- Atomic<Mode> m_mode { Mode::Unlocked };
+ Atomic<Mode, AK::MemoryOrder::memory_order_relaxed> m_mode { Mode::Unlocked };
// When locked exclusively, only the thread already holding the lock can
// lock it again. When locked in shared mode, any thread can do that.