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

@ -34,7 +34,7 @@ public:
void unblock()
{
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
do_unblock([&](auto& b, void* data, bool&) {
VERIFY(b.blocker_type() == Thread::Blocker::Type::File);
auto& blocker = static_cast<Thread::FileBlocker&>(b);

View file

@ -412,7 +412,7 @@ Plan9FS::ReceiveCompletion::~ReceiveCompletion()
bool Plan9FS::Blocker::unblock(u16 tag)
{
{
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
if (m_did_unblock)
return false;
m_did_unblock = true;
@ -428,7 +428,7 @@ bool Plan9FS::Blocker::unblock(u16 tag)
void Plan9FS::Blocker::not_blocking(bool)
{
{
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
if (m_did_unblock)
return;
}
@ -438,7 +438,7 @@ void Plan9FS::Blocker::not_blocking(bool)
bool Plan9FS::Blocker::is_completed() const
{
ScopedSpinlock lock(m_completion->lock);
SpinlockLocker lock(m_completion->lock);
return m_completion->completed;
}
@ -470,7 +470,7 @@ void Plan9FS::Plan9FSBlockCondition::unblock_all()
void Plan9FS::Plan9FSBlockCondition::try_unblock(Plan9FS::Blocker& blocker)
{
if (m_fs.is_complete(*blocker.completion())) {
ScopedSpinlock lock(m_lock);
SpinlockLocker lock(m_lock);
blocker.unblock(blocker.completion()->tag);
}
}
@ -576,7 +576,7 @@ KResult Plan9FS::read_and_dispatch_one_message()
auto optional_completion = m_completions.get(header.tag);
if (optional_completion.has_value()) {
auto completion = optional_completion.value();
ScopedSpinlock lock(completion->lock);
SpinlockLocker lock(completion->lock);
completion->result = KSuccess;
completion->message = adopt_own_if_nonnull(new (nothrow) Message { buffer.release_nonnull() });
completion->completed = true;
@ -666,7 +666,7 @@ void Plan9FS::thread_main()
void Plan9FS::ensure_thread()
{
ScopedSpinlock lock(m_thread_lock);
SpinlockLocker lock(m_thread_lock);
if (!m_thread_running.exchange(true, AK::MemoryOrder::memory_order_acq_rel)) {
Process::create_kernel_process(m_thread, "Plan9FS", [&]() {
thread_main();

View file

@ -14,7 +14,7 @@ static InodeIndex s_next_inode_index { 0 };
static size_t allocate_inode_index()
{
ScopedSpinlock lock(s_index_lock);
SpinlockLocker lock(s_index_lock);
s_next_inode_index = s_next_inode_index.value() + 1;
VERIFY(s_next_inode_index > 0);
return s_next_inode_index.value();