summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/FileSystem/Inode.cpp4
-rw-r--r--Kernel/FileSystem/Inode.h2
-rw-r--r--Kernel/Library/ListedRefCounted.h2
-rw-r--r--Kernel/Locking/SpinLockProtected.h (renamed from Kernel/Locking/SpinLockProtectedValue.h)9
-rw-r--r--Kernel/Memory/VMObject.cpp4
-rw-r--r--Kernel/Memory/VMObject.h2
-rw-r--r--Kernel/Process.h6
-rw-r--r--Kernel/ProcessGroup.cpp4
-rw-r--r--Kernel/ProcessGroup.h4
-rw-r--r--Kernel/Scheduler.cpp4
-rw-r--r--Kernel/TTY/SlavePTY.cpp4
-rw-r--r--Kernel/TTY/SlavePTY.h2
-rw-r--r--Kernel/Thread.cpp4
-rw-r--r--Kernel/Thread.h4
14 files changed, 28 insertions, 27 deletions
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<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;
}
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, RawPtr<Inode>, &Inode::m_inode_list_node>;
- static SpinLockProtectedValue<Inode::AllInstancesList>& all_instances();
+ static SpinLockProtected<Inode::AllInstancesList>& 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<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.
diff --git a/Kernel/Locking/SpinLockProtectedValue.h b/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<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
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<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;
}
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, RawPtr<VMObject>, &VMObject::m_list_node>;
- static SpinLockProtectedValue<VMObject::AllInstancesList>& all_instances();
+ static SpinLockProtected<VMObject::AllInstancesList>& all_instances();
};
template<typename Callback>
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::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;
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<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;
}
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 <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();
}
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<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
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<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;
}
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, RawPtr<SlavePTY>, &SlavePTY::m_list_node>;
- static SpinLockProtectedValue<SlavePTY::List>& all_instances();
+ static SpinLockProtected<SlavePTY::List>& 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<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;
}
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 <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);