1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +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

@ -116,15 +116,14 @@ private:
};
template<typename LockType>
class [[nodiscard]] ScopedSpinlock {
AK_MAKE_NONCOPYABLE(ScopedSpinlock);
class [[nodiscard]] SpinlockLocker {
AK_MAKE_NONCOPYABLE(SpinlockLocker);
public:
ScopedSpinlock() = delete;
ScopedSpinlock& operator=(ScopedSpinlock&&) = delete;
SpinlockLocker() = delete;
SpinlockLocker& operator=(SpinlockLocker&&) = delete;
ScopedSpinlock(LockType& lock)
SpinlockLocker(LockType& lock)
: m_lock(&lock)
{
VERIFY(m_lock);
@ -132,7 +131,7 @@ public:
m_have_lock = true;
}
ScopedSpinlock(ScopedSpinlock&& from)
SpinlockLocker(SpinlockLocker&& from)
: m_lock(from.m_lock)
, m_prev_flags(from.m_prev_flags)
, m_have_lock(from.m_have_lock)
@ -142,7 +141,7 @@ public:
from.m_have_lock = false;
}
~ScopedSpinlock()
~SpinlockLocker()
{
if (m_lock && m_have_lock) {
m_lock->unlock(m_prev_flags);