mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Convert lock debug APIs to east const
This commit is contained in:
parent
bffcb3e92a
commit
464dc42640
Notes:
sideshowbarker
2024-07-18 07:01:17 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/464dc426409 Pull-request: https://github.com/SerenityOS/serenity/pull/9261 Reviewed-by: https://github.com/alimpfard ✅
3 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue