mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +00:00
Kernel: Specify default memory order for some non-synchronizing Atomics
This commit is contained in:
parent
fb84f0ec9c
commit
901ef3f1c8
12 changed files with 44 additions and 43 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue