Jelajahi Sumber

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

Andreas Kling 4 tahun lalu
induk
melakukan
ed6f84c2c9

+ 2 - 2
Kernel/FileSystem/Inode.cpp

@@ -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;
 }

+ 1 - 1
Kernel/FileSystem/Inode.h

@@ -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();
 };
 
 }

+ 1 - 1
Kernel/Library/ListedRefCounted.h

@@ -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.
 

+ 5 - 4
Kernel/Locking/SpinLockProtectedValue.h → Kernel/Locking/SpinLockProtected.h

@@ -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

+ 2 - 2
Kernel/Memory/VMObject.cpp

@@ -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;
 }

+ 1 - 1
Kernel/Memory/VMObject.h

@@ -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>

+ 3 - 3
Kernel/Process.h

@@ -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;
 

+ 2 - 2
Kernel/ProcessGroup.cpp

@@ -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;
 }

+ 2 - 2
Kernel/ProcessGroup.h

@@ -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();
 
 }

+ 2 - 2
Kernel/Scheduler.cpp

@@ -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

+ 2 - 2
Kernel/TTY/SlavePTY.cpp

@@ -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;
 }

+ 1 - 1
Kernel/TTY/SlavePTY.h

@@ -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();
 };
 
 }

+ 2 - 2
Kernel/Thread.cpp

@@ -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;
 }

+ 2 - 2
Kernel/Thread.h

@@ -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);