1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 19:45:08 +00:00

Kernel: Rename ScopedSpinlock => SpinlockLocker

This matches MutexLocker, and doesn't sound like it's a lock itself.
This commit is contained in:
Andreas Kling 2021-08-22 01:49:22 +02:00
parent 55adace359
commit c922a7da09
78 changed files with 365 additions and 366 deletions

View file

@ -21,7 +21,7 @@ void Mutex::lock(Mode mode, [[maybe_unused]] LockLocation const& location)
VERIFY(mode != Mode::Unlocked);
auto current_thread = Thread::current();
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
bool did_block = false;
Mode current_mode = m_mode;
switch (current_mode) {
@ -145,7 +145,7 @@ void Mutex::unlock()
// and also from within critical sections!
VERIFY(!Processor::current().in_irq());
auto current_thread = Thread::current();
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
Mode current_mode = m_mode;
if constexpr (LOCK_TRACE_DEBUG) {
if (current_mode == Mode::Shared)
@ -196,7 +196,7 @@ void Mutex::unlock()
}
}
void Mutex::block(Thread& current_thread, Mode mode, ScopedSpinlock<Spinlock<u8>>& lock, u32 requested_locks)
void Mutex::block(Thread& current_thread, Mode mode, SpinlockLocker<Spinlock<u8>>& lock, u32 requested_locks)
{
auto& blocked_thread_list = thread_list_for_mode(mode);
VERIFY(!blocked_thread_list.contains(current_thread));
@ -255,7 +255,7 @@ auto Mutex::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode
// and also from within critical sections!
VERIFY(!Processor::current().in_irq());
auto current_thread = Thread::current();
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
auto current_mode = m_mode;
switch (current_mode) {
case Mode::Exclusive: {
@ -319,7 +319,7 @@ void Mutex::restore_lock(Mode mode, u32 lock_count, [[maybe_unused]] LockLocatio
VERIFY(!Processor::current().in_irq());
auto current_thread = Thread::current();
bool did_block = false;
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
switch (mode) {
case Mode::Exclusive: {
auto previous_mode = m_mode;