Kernel: Rename SpinLockProtectedValue<T> => SpinLockProtected<T>

This commit is contained in:
Andreas Kling 2021-08-22 00:28:07 +02:00
parent 532ffa7ddb
commit ed6f84c2c9
Notes: sideshowbarker 2024-07-18 05:24:59 +09:00
14 changed files with 28 additions and 27 deletions

View file

@ -22,9 +22,9 @@
namespace Kernel {
static Singleton<SpinLockProtectedValue<Inode::AllInstancesList>> s_all_instances;
static Singleton<SpinLockProtected<Inode::AllInstancesList>> s_all_instances;
SpinLockProtectedValue<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 SpinLockProtectedValue<Inode::AllInstancesList>& all_instances();
static SpinLockProtected<Inode::AllInstancesList>& all_instances();
};
}

View file

@ -11,7 +11,7 @@
namespace Kernel {
// ListedRefCounted<T> is a slot-in replacement for RefCounted<T> to use in classes
// that add themselves to a SpinLockProtectedValue<IntrusiveList> when constructed.
// that add themselves to a SpinLockProtected<IntrusiveList> when constructed.
// The custom unref() implementation here ensures that the the list is locked during
// unref(), and that the T is removed from the list before ~T() is invoked.

View file

@ -11,10 +11,11 @@
namespace Kernel {
template<typename T>
class SpinLockProtectedValue : private T
class SpinLockProtected
: private T
, public SpinLockContendedResource {
AK_MAKE_NONCOPYABLE(SpinLockProtectedValue);
AK_MAKE_NONMOVABLE(SpinLockProtectedValue);
AK_MAKE_NONCOPYABLE(SpinLockProtected);
AK_MAKE_NONMOVABLE(SpinLockProtected);
protected:
using LockedConst = SpinLockLockedResource<T const>;
@ -26,7 +27,7 @@ protected:
public:
using T::T;
SpinLockProtectedValue() = default;
SpinLockProtected() = default;
template<typename Callback>
decltype(auto) with(Callback callback) const

View file

@ -10,9 +10,9 @@
namespace Kernel::Memory {
static Singleton<SpinLockProtectedValue<VMObject::AllInstancesList>> s_all_instances;
static Singleton<SpinLockProtected<VMObject::AllInstancesList>> s_all_instances;
SpinLockProtectedValue<VMObject::AllInstancesList>& VMObject::all_instances()
SpinLockProtected<VMObject::AllInstancesList>& VMObject::all_instances()
{
return s_all_instances;
}

View file

@ -74,7 +74,7 @@ private:
public:
using AllInstancesList = IntrusiveList<VMObject, RawPtr<VMObject>, &VMObject::m_list_node>;
static SpinLockProtectedValue<VMObject::AllInstancesList>& all_instances();
static SpinLockProtected<VMObject::AllInstancesList>& all_instances();
};
template<typename Callback>

View file

@ -743,10 +743,10 @@ public:
const FileDescriptions& fds() const { return m_fds; }
private:
SpinLockProtectedValue<Thread::ListInProcess>& thread_list() { return m_thread_list; }
SpinLockProtectedValue<Thread::ListInProcess> const& thread_list() const { return m_thread_list; }
SpinLockProtected<Thread::ListInProcess>& thread_list() { return m_thread_list; }
SpinLockProtected<Thread::ListInProcess> const& thread_list() const { return m_thread_list; }
SpinLockProtectedValue<Thread::ListInProcess> m_thread_list;
SpinLockProtected<Thread::ListInProcess> m_thread_list;
FileDescriptions m_fds;

View file

@ -10,9 +10,9 @@
namespace Kernel {
static Singleton<SpinLockProtectedValue<ProcessGroup::List>> s_process_groups;
static Singleton<SpinLockProtected<ProcessGroup::List>> s_process_groups;
SpinLockProtectedValue<ProcessGroup::List>& process_groups()
SpinLockProtected<ProcessGroup::List>& process_groups()
{
return *s_process_groups;
}

View file

@ -9,7 +9,7 @@
#include <AK/IntrusiveList.h>
#include <AK/RefCounted.h>
#include <AK/Weakable.h>
#include <Kernel/Locking/SpinLockProtectedValue.h>
#include <Kernel/Locking/SpinLockProtected.h>
#include <Kernel/UnixTypes.h>
namespace Kernel {
@ -43,6 +43,6 @@ public:
using List = IntrusiveList<ProcessGroup, RawPtr<ProcessGroup>, &ProcessGroup::m_list_node>;
};
SpinLockProtectedValue<ProcessGroup::List>& process_groups();
SpinLockProtected<ProcessGroup::List>& process_groups();
}

View file

@ -53,9 +53,9 @@ struct ThreadReadyQueues {
Array<ThreadReadyQueue, count> queues;
};
static Singleton<SpinLockProtectedValue<ThreadReadyQueues>> g_ready_queues;
static Singleton<SpinLockProtected<ThreadReadyQueues>> g_ready_queues;
static SpinLockProtectedValue<TotalTimeScheduled> g_total_time_scheduled;
static SpinLockProtected<TotalTimeScheduled> g_total_time_scheduled;
// The Scheduler::current_time function provides a current time for scheduling purposes,
// which may not necessarily relate to wall time

View file

@ -13,9 +13,9 @@
namespace Kernel {
static Singleton<SpinLockProtectedValue<SlavePTY::List>> s_all_instances;
static Singleton<SpinLockProtected<SlavePTY::List>> s_all_instances;
SpinLockProtectedValue<SlavePTY::List>& SlavePTY::all_instances()
SpinLockProtected<SlavePTY::List>& SlavePTY::all_instances()
{
return s_all_instances;
}

View file

@ -53,7 +53,7 @@ private:
public:
using List = IntrusiveList<SlavePTY, RawPtr<SlavePTY>, &SlavePTY::m_list_node>;
static SpinLockProtectedValue<SlavePTY::List>& all_instances();
static SpinLockProtected<SlavePTY::List>& all_instances();
};
}

View file

@ -30,9 +30,9 @@
namespace Kernel {
static Singleton<SpinLockProtectedValue<Thread::GlobalList>> s_list;
static Singleton<SpinLockProtected<Thread::GlobalList>> s_list;
SpinLockProtectedValue<Thread::GlobalList>& Thread::all_instances()
SpinLockProtected<Thread::GlobalList>& Thread::all_instances()
{
return *s_list;
}

View file

@ -27,7 +27,7 @@
#include <Kernel/Library/ListedRefCounted.h>
#include <Kernel/Locking/LockLocation.h>
#include <Kernel/Locking/LockMode.h>
#include <Kernel/Locking/SpinLockProtectedValue.h>
#include <Kernel/Locking/SpinLockProtected.h>
#include <Kernel/Memory/VirtualRange.h>
#include <Kernel/Scheduler.h>
#include <Kernel/TimerQueue.h>
@ -1389,7 +1389,7 @@ public:
using ListInProcess = IntrusiveList<Thread, RawPtr<Thread>, &Thread::m_process_thread_list_node>;
using GlobalList = IntrusiveList<Thread, RawPtr<Thread>, &Thread::m_global_thread_list_node>;
static SpinLockProtectedValue<GlobalList>& all_instances();
static SpinLockProtected<GlobalList>& all_instances();
};
AK_ENUM_BITWISE_OPERATORS(Thread::FileBlocker::BlockFlags);