mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Kernel: Specify default memory order for some non-synchronizing Atomics
This commit is contained in:
parent
fb84f0ec9c
commit
901ef3f1c8
Notes:
sideshowbarker
2024-07-19 00:07:11 +09:00
Author: https://github.com/tomuta
Commit: 901ef3f1c8
Pull-request: https://github.com/SerenityOS/serenity/pull/4783
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