mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 04:50:29 +00:00
Kernel: Add implied auto-specifiers in Locking
As per clang-tidy.
This commit is contained in:
parent
a7209ca0f9
commit
1ad4a190b5
Notes:
sideshowbarker
2024-07-17 22:44:55 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/1ad4a190b5c Pull-request: https://github.com/SerenityOS/serenity/pull/11201 Reviewed-by: https://github.com/bgianfo Reviewed-by: https://github.com/davidot
2 changed files with 6 additions and 6 deletions
|
@ -15,7 +15,7 @@ namespace Kernel {
|
|||
void track_lock_acquire(LockRank rank)
|
||||
{
|
||||
if constexpr (LOCK_RANK_ENFORCEMENT) {
|
||||
auto thread = Thread::current();
|
||||
auto* thread = Thread::current();
|
||||
if (thread && !thread->is_crashing())
|
||||
thread->track_lock_acquire(rank);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ void track_lock_acquire(LockRank rank)
|
|||
void track_lock_release(LockRank rank)
|
||||
{
|
||||
if constexpr (LOCK_RANK_ENFORCEMENT) {
|
||||
auto thread = Thread::current();
|
||||
auto* thread = Thread::current();
|
||||
if (thread && !thread->is_crashing())
|
||||
thread->track_lock_release(rank);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ void Mutex::lock(Mode mode, [[maybe_unused]] LockLocation const& location)
|
|||
if constexpr (LOCK_IN_CRITICAL_DEBUG)
|
||||
VERIFY_INTERRUPTS_ENABLED();
|
||||
VERIFY(mode != Mode::Unlocked);
|
||||
auto current_thread = Thread::current();
|
||||
auto* current_thread = Thread::current();
|
||||
|
||||
SpinlockLocker lock(m_lock);
|
||||
bool did_block = false;
|
||||
|
@ -148,7 +148,7 @@ void Mutex::unlock()
|
|||
if constexpr (LOCK_IN_CRITICAL_DEBUG)
|
||||
VERIFY_INTERRUPTS_ENABLED();
|
||||
VERIFY(!Processor::current_in_irq());
|
||||
auto current_thread = Thread::current();
|
||||
auto* current_thread = Thread::current();
|
||||
SpinlockLocker lock(m_lock);
|
||||
Mode current_mode = m_mode;
|
||||
if constexpr (LOCK_TRACE_DEBUG) {
|
||||
|
@ -260,7 +260,7 @@ auto Mutex::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode
|
|||
// NOTE: This may be called from an interrupt handler (not an IRQ handler)
|
||||
// and also from within critical sections!
|
||||
VERIFY(!Processor::current_in_irq());
|
||||
auto current_thread = Thread::current();
|
||||
auto* current_thread = Thread::current();
|
||||
SpinlockLocker lock(m_lock);
|
||||
auto current_mode = m_mode;
|
||||
switch (current_mode) {
|
||||
|
@ -323,7 +323,7 @@ void Mutex::restore_lock(Mode mode, u32 lock_count, [[maybe_unused]] LockLocatio
|
|||
VERIFY(mode != Mode::Unlocked);
|
||||
VERIFY(lock_count > 0);
|
||||
VERIFY(!Processor::current_in_irq());
|
||||
auto current_thread = Thread::current();
|
||||
auto* current_thread = Thread::current();
|
||||
bool did_block = false;
|
||||
SpinlockLocker lock(m_lock);
|
||||
switch (mode) {
|
||||
|
|
Loading…
Reference in a new issue