diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-08-07 04:58:07 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-13 20:42:39 +0200 |
commit | 464dc426409201edcc40e1dfd5f2ce99747b8938 (patch) | |
tree | ac0538d56d10bd64cf7c310d8a650055c137fc1e /Kernel | |
parent | bffcb3e92a9158f6117546db7b7b38d1a5f32225 (diff) | |
download | serenity-464dc426409201edcc40e1dfd5f2ce99747b8938.zip |
Kernel: Convert lock debug APIs to east const
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Locking/Mutex.cpp | 4 | ||||
-rw-r--r-- | Kernel/Locking/Mutex.h | 10 | ||||
-rw-r--r-- | Kernel/Thread.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/Locking/Mutex.cpp b/Kernel/Locking/Mutex.cpp index 82cbc45725..ad2a302919 100644 --- a/Kernel/Locking/Mutex.cpp +++ b/Kernel/Locking/Mutex.cpp @@ -13,7 +13,7 @@ namespace Kernel { -void Mutex::lock(Mode mode, [[maybe_unused]] const LockLocation& location) +void Mutex::lock(Mode mode, [[maybe_unused]] LockLocation const& location) { // NOTE: This may be called from an interrupt handler (not an IRQ handler) // and also from within critical sections! @@ -312,7 +312,7 @@ auto Mutex::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode return current_mode; } -void Mutex::restore_lock(Mode mode, u32 lock_count, [[maybe_unused]] const LockLocation& location) +void Mutex::restore_lock(Mode mode, u32 lock_count, [[maybe_unused]] LockLocation const& location) { VERIFY(mode != Mode::Unlocked); VERIFY(lock_count > 0); diff --git a/Kernel/Locking/Mutex.h b/Kernel/Locking/Mutex.h index 802d7eff44..f29663ecb6 100644 --- a/Kernel/Locking/Mutex.h +++ b/Kernel/Locking/Mutex.h @@ -32,8 +32,8 @@ public: } ~Mutex() = default; - void lock(Mode mode = Mode::Exclusive, const LockLocation& location = LockLocation::current()); - void restore_lock(Mode, u32, const LockLocation& location = LockLocation::current()); + void lock(Mode mode = Mode::Exclusive, LockLocation const& location = LockLocation::current()); + void restore_lock(Mode, u32, LockLocation const& location = LockLocation::current()); void unlock(); [[nodiscard]] Mode force_unlock_if_locked(u32&); @@ -111,7 +111,7 @@ public: { } - ALWAYS_INLINE explicit MutexLocker(Mutex& l, Mutex::Mode mode = Mutex::Mode::Exclusive, const LockLocation& location = LockLocation::current()) + ALWAYS_INLINE explicit MutexLocker(Mutex& l, Mutex::Mode mode = Mutex::Mode::Exclusive, LockLocation const& location = LockLocation::current()) : m_lock(&l) { m_lock->lock(mode, location); @@ -131,7 +131,7 @@ public: m_lock->unlock(); } - ALWAYS_INLINE void attach_and_lock(Mutex& lock, Mutex::Mode mode = Mutex::Mode::Exclusive, const LockLocation& location = LockLocation::current()) + ALWAYS_INLINE void attach_and_lock(Mutex& lock, Mutex::Mode mode = Mutex::Mode::Exclusive, LockLocation const& location = LockLocation::current()) { VERIFY(!m_locked); m_lock = &lock; @@ -140,7 +140,7 @@ public: m_lock->lock(mode, location); } - ALWAYS_INLINE void lock(Mutex::Mode mode = Mutex::Mode::Exclusive, const LockLocation& location = LockLocation::current()) + ALWAYS_INLINE void lock(Mutex::Mode mode = Mutex::Mode::Exclusive, LockLocation const& location = LockLocation::current()) { VERIFY(m_lock); VERIFY(!m_locked); diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 3609ecbc8f..4d8989deb3 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -1150,7 +1150,7 @@ public: RecursiveSpinLock& get_lock() const { return m_lock; } #if LOCK_DEBUG - void holding_lock(Mutex& lock, int refs_delta, const LockLocation& location) + void holding_lock(Mutex& lock, int refs_delta, LockLocation const& location) { VERIFY(refs_delta != 0); m_holding_locks.fetch_add(refs_delta, AK::MemoryOrder::memory_order_relaxed); |