1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

Kernel: Rename SpinLock => Spinlock

This commit is contained in:
Andreas Kling 2021-08-22 01:37:17 +02:00
parent 7d5d26b048
commit 55adace359
110 changed files with 491 additions and 491 deletions

View file

@ -34,7 +34,7 @@ public:
void unblock()
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock 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

@ -22,9 +22,9 @@
namespace Kernel {
static Singleton<SpinLockProtected<Inode::AllInstancesList>> s_all_instances;
static Singleton<SpinlockProtected<Inode::AllInstancesList>> s_all_instances;
SpinLockProtected<Inode::AllInstancesList>& Inode::all_instances()
SpinlockProtected<Inode::AllInstancesList>& Inode::all_instances()
{
return s_all_instances;
}

View file

@ -135,7 +135,7 @@ private:
public:
using AllInstancesList = IntrusiveList<Inode, RawPtr<Inode>, &Inode::m_inode_list_node>;
static SpinLockProtected<Inode::AllInstancesList>& all_instances();
static SpinlockProtected<Inode::AllInstancesList>& all_instances();
};
}

View file

@ -412,7 +412,7 @@ Plan9FS::ReceiveCompletion::~ReceiveCompletion()
bool Plan9FS::Blocker::unblock(u16 tag)
{
{
ScopedSpinLock lock(m_lock);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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);
ScopedSpinlock 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

@ -66,11 +66,11 @@ private:
private:
Plan9FS& m_fs;
mutable SpinLock<u8> m_lock;
mutable Spinlock<u8> m_lock;
};
struct ReceiveCompletion : public RefCounted<ReceiveCompletion> {
mutable SpinLock<u8> lock;
mutable Spinlock<u8> lock;
bool completed { false };
const u16 tag;
OwnPtr<Message> message;
@ -139,7 +139,7 @@ private:
Plan9FSBlockCondition m_completion_blocker;
HashMap<u16, NonnullRefPtr<ReceiveCompletion>> m_completions;
SpinLock<u8> m_thread_lock;
Spinlock<u8> m_thread_lock;
RefPtr<Thread> m_thread;
Atomic<bool> m_thread_running { false };
Atomic<bool, AK::MemoryOrder::memory_order_relaxed> m_thread_shutdown { false };

View file

@ -9,12 +9,12 @@
namespace Kernel {
static SpinLock<u8> s_index_lock;
static Spinlock<u8> s_index_lock;
static InodeIndex s_next_inode_index { 0 };
static size_t allocate_inode_index()
{
ScopedSpinLock lock(s_index_lock);
ScopedSpinlock 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();