diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index bab4ade7e5..4d30567a86 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -22,9 +22,9 @@ namespace Kernel { -static Singleton> s_all_instances; +static Singleton> s_all_instances; -SpinLockProtectedValue& Inode::all_instances() +SpinLockProtected& Inode::all_instances() { return s_all_instances; } diff --git a/Kernel/FileSystem/Inode.h b/Kernel/FileSystem/Inode.h index c2ebbdb7ae..564a237544 100644 --- a/Kernel/FileSystem/Inode.h +++ b/Kernel/FileSystem/Inode.h @@ -135,7 +135,7 @@ private: public: using AllInstancesList = IntrusiveList, &Inode::m_inode_list_node>; - static SpinLockProtectedValue& all_instances(); + static SpinLockProtected& all_instances(); }; } diff --git a/Kernel/Library/ListedRefCounted.h b/Kernel/Library/ListedRefCounted.h index 6eaefee27b..04986173c8 100644 --- a/Kernel/Library/ListedRefCounted.h +++ b/Kernel/Library/ListedRefCounted.h @@ -11,7 +11,7 @@ namespace Kernel { // ListedRefCounted is a slot-in replacement for RefCounted to use in classes -// that add themselves to a SpinLockProtectedValue when constructed. +// that add themselves to a SpinLockProtected 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. diff --git a/Kernel/Locking/SpinLockProtectedValue.h b/Kernel/Locking/SpinLockProtected.h similarity index 88% rename from Kernel/Locking/SpinLockProtectedValue.h rename to Kernel/Locking/SpinLockProtected.h index e4af19d8a3..143eb98133 100644 --- a/Kernel/Locking/SpinLockProtectedValue.h +++ b/Kernel/Locking/SpinLockProtected.h @@ -11,10 +11,11 @@ namespace Kernel { template -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; @@ -26,7 +27,7 @@ protected: public: using T::T; - SpinLockProtectedValue() = default; + SpinLockProtected() = default; template decltype(auto) with(Callback callback) const diff --git a/Kernel/Memory/VMObject.cpp b/Kernel/Memory/VMObject.cpp index e151f9bde2..837611a370 100644 --- a/Kernel/Memory/VMObject.cpp +++ b/Kernel/Memory/VMObject.cpp @@ -10,9 +10,9 @@ namespace Kernel::Memory { -static Singleton> s_all_instances; +static Singleton> s_all_instances; -SpinLockProtectedValue& VMObject::all_instances() +SpinLockProtected& VMObject::all_instances() { return s_all_instances; } diff --git a/Kernel/Memory/VMObject.h b/Kernel/Memory/VMObject.h index 132851e0ca..c6f06b2ce8 100644 --- a/Kernel/Memory/VMObject.h +++ b/Kernel/Memory/VMObject.h @@ -74,7 +74,7 @@ private: public: using AllInstancesList = IntrusiveList, &VMObject::m_list_node>; - static SpinLockProtectedValue& all_instances(); + static SpinLockProtected& all_instances(); }; template diff --git a/Kernel/Process.h b/Kernel/Process.h index 07edcd12a1..b707df242f 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -743,10 +743,10 @@ public: const FileDescriptions& fds() const { return m_fds; } private: - SpinLockProtectedValue& thread_list() { return m_thread_list; } - SpinLockProtectedValue const& thread_list() const { return m_thread_list; } + SpinLockProtected& thread_list() { return m_thread_list; } + SpinLockProtected const& thread_list() const { return m_thread_list; } - SpinLockProtectedValue m_thread_list; + SpinLockProtected m_thread_list; FileDescriptions m_fds; diff --git a/Kernel/ProcessGroup.cpp b/Kernel/ProcessGroup.cpp index 0f90ffd4c0..319ef6361b 100644 --- a/Kernel/ProcessGroup.cpp +++ b/Kernel/ProcessGroup.cpp @@ -10,9 +10,9 @@ namespace Kernel { -static Singleton> s_process_groups; +static Singleton> s_process_groups; -SpinLockProtectedValue& process_groups() +SpinLockProtected& process_groups() { return *s_process_groups; } diff --git a/Kernel/ProcessGroup.h b/Kernel/ProcessGroup.h index 1fdea593ed..13ea71341c 100644 --- a/Kernel/ProcessGroup.h +++ b/Kernel/ProcessGroup.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include namespace Kernel { @@ -43,6 +43,6 @@ public: using List = IntrusiveList, &ProcessGroup::m_list_node>; }; -SpinLockProtectedValue& process_groups(); +SpinLockProtected& process_groups(); } diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 426ba3546f..fd29758fe0 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -53,9 +53,9 @@ struct ThreadReadyQueues { Array queues; }; -static Singleton> g_ready_queues; +static Singleton> g_ready_queues; -static SpinLockProtectedValue g_total_time_scheduled; +static SpinLockProtected g_total_time_scheduled; // The Scheduler::current_time function provides a current time for scheduling purposes, // which may not necessarily relate to wall time diff --git a/Kernel/TTY/SlavePTY.cpp b/Kernel/TTY/SlavePTY.cpp index 4655badf9c..06c5b4ef45 100644 --- a/Kernel/TTY/SlavePTY.cpp +++ b/Kernel/TTY/SlavePTY.cpp @@ -13,9 +13,9 @@ namespace Kernel { -static Singleton> s_all_instances; +static Singleton> s_all_instances; -SpinLockProtectedValue& SlavePTY::all_instances() +SpinLockProtected& SlavePTY::all_instances() { return s_all_instances; } diff --git a/Kernel/TTY/SlavePTY.h b/Kernel/TTY/SlavePTY.h index d8c44659c4..8ebd0368a8 100644 --- a/Kernel/TTY/SlavePTY.h +++ b/Kernel/TTY/SlavePTY.h @@ -53,7 +53,7 @@ private: public: using List = IntrusiveList, &SlavePTY::m_list_node>; - static SpinLockProtectedValue& all_instances(); + static SpinLockProtected& all_instances(); }; } diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 2408dfac5c..996b5eba17 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -30,9 +30,9 @@ namespace Kernel { -static Singleton> s_list; +static Singleton> s_list; -SpinLockProtectedValue& Thread::all_instances() +SpinLockProtected& Thread::all_instances() { return *s_list; } diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 602058b4da..4007d4f5ba 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -1389,7 +1389,7 @@ public: using ListInProcess = IntrusiveList, &Thread::m_process_thread_list_node>; using GlobalList = IntrusiveList, &Thread::m_global_thread_list_node>; - static SpinLockProtectedValue& all_instances(); + static SpinLockProtected& all_instances(); }; AK_ENUM_BITWISE_OPERATORS(Thread::FileBlocker::BlockFlags);