mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:07:34 +00:00
Kernel: Rename SpinLockProtectedValue<T> => SpinLockProtected<T>
This commit is contained in:
parent
532ffa7ddb
commit
ed6f84c2c9
14 changed files with 28 additions and 27 deletions
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
namespace Kernel {
|
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;
|
return s_all_instances;
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using AllInstancesList = IntrusiveList<Inode, RawPtr<Inode>, &Inode::m_inode_list_node>;
|
using AllInstancesList = IntrusiveList<Inode, RawPtr<Inode>, &Inode::m_inode_list_node>;
|
||||||
static SpinLockProtectedValue<Inode::AllInstancesList>& all_instances();
|
static SpinLockProtected<Inode::AllInstancesList>& all_instances();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
// ListedRefCounted<T> is a slot-in replacement for RefCounted<T> to use in classes
|
// 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
|
// 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.
|
// unref(), and that the T is removed from the list before ~T() is invoked.
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,11 @@
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class SpinLockProtectedValue : private T
|
class SpinLockProtected
|
||||||
|
: private T
|
||||||
, public SpinLockContendedResource {
|
, public SpinLockContendedResource {
|
||||||
AK_MAKE_NONCOPYABLE(SpinLockProtectedValue);
|
AK_MAKE_NONCOPYABLE(SpinLockProtected);
|
||||||
AK_MAKE_NONMOVABLE(SpinLockProtectedValue);
|
AK_MAKE_NONMOVABLE(SpinLockProtected);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using LockedConst = SpinLockLockedResource<T const>;
|
using LockedConst = SpinLockLockedResource<T const>;
|
||||||
|
@ -26,7 +27,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
using T::T;
|
using T::T;
|
||||||
|
|
||||||
SpinLockProtectedValue() = default;
|
SpinLockProtected() = default;
|
||||||
|
|
||||||
template<typename Callback>
|
template<typename Callback>
|
||||||
decltype(auto) with(Callback callback) const
|
decltype(auto) with(Callback callback) const
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
namespace Kernel::Memory {
|
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;
|
return s_all_instances;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using AllInstancesList = IntrusiveList<VMObject, RawPtr<VMObject>, &VMObject::m_list_node>;
|
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>
|
template<typename Callback>
|
||||||
|
|
|
@ -743,10 +743,10 @@ public:
|
||||||
const FileDescriptions& fds() const { return m_fds; }
|
const FileDescriptions& fds() const { return m_fds; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SpinLockProtectedValue<Thread::ListInProcess>& thread_list() { return m_thread_list; }
|
SpinLockProtected<Thread::ListInProcess>& thread_list() { return m_thread_list; }
|
||||||
SpinLockProtectedValue<Thread::ListInProcess> const& thread_list() const { 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;
|
FileDescriptions m_fds;
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
namespace Kernel {
|
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;
|
return *s_process_groups;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <AK/IntrusiveList.h>
|
#include <AK/IntrusiveList.h>
|
||||||
#include <AK/RefCounted.h>
|
#include <AK/RefCounted.h>
|
||||||
#include <AK/Weakable.h>
|
#include <AK/Weakable.h>
|
||||||
#include <Kernel/Locking/SpinLockProtectedValue.h>
|
#include <Kernel/Locking/SpinLockProtected.h>
|
||||||
#include <Kernel/UnixTypes.h>
|
#include <Kernel/UnixTypes.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
@ -43,6 +43,6 @@ public:
|
||||||
using List = IntrusiveList<ProcessGroup, RawPtr<ProcessGroup>, &ProcessGroup::m_list_node>;
|
using List = IntrusiveList<ProcessGroup, RawPtr<ProcessGroup>, &ProcessGroup::m_list_node>;
|
||||||
};
|
};
|
||||||
|
|
||||||
SpinLockProtectedValue<ProcessGroup::List>& process_groups();
|
SpinLockProtected<ProcessGroup::List>& process_groups();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,9 +53,9 @@ struct ThreadReadyQueues {
|
||||||
Array<ThreadReadyQueue, count> queues;
|
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,
|
// The Scheduler::current_time function provides a current time for scheduling purposes,
|
||||||
// which may not necessarily relate to wall time
|
// which may not necessarily relate to wall time
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
|
|
||||||
namespace Kernel {
|
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;
|
return s_all_instances;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using List = IntrusiveList<SlavePTY, RawPtr<SlavePTY>, &SlavePTY::m_list_node>;
|
using List = IntrusiveList<SlavePTY, RawPtr<SlavePTY>, &SlavePTY::m_list_node>;
|
||||||
static SpinLockProtectedValue<SlavePTY::List>& all_instances();
|
static SpinLockProtected<SlavePTY::List>& all_instances();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
namespace Kernel {
|
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;
|
return *s_list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <Kernel/Library/ListedRefCounted.h>
|
#include <Kernel/Library/ListedRefCounted.h>
|
||||||
#include <Kernel/Locking/LockLocation.h>
|
#include <Kernel/Locking/LockLocation.h>
|
||||||
#include <Kernel/Locking/LockMode.h>
|
#include <Kernel/Locking/LockMode.h>
|
||||||
#include <Kernel/Locking/SpinLockProtectedValue.h>
|
#include <Kernel/Locking/SpinLockProtected.h>
|
||||||
#include <Kernel/Memory/VirtualRange.h>
|
#include <Kernel/Memory/VirtualRange.h>
|
||||||
#include <Kernel/Scheduler.h>
|
#include <Kernel/Scheduler.h>
|
||||||
#include <Kernel/TimerQueue.h>
|
#include <Kernel/TimerQueue.h>
|
||||||
|
@ -1389,7 +1389,7 @@ public:
|
||||||
using ListInProcess = IntrusiveList<Thread, RawPtr<Thread>, &Thread::m_process_thread_list_node>;
|
using ListInProcess = IntrusiveList<Thread, RawPtr<Thread>, &Thread::m_process_thread_list_node>;
|
||||||
using GlobalList = IntrusiveList<Thread, RawPtr<Thread>, &Thread::m_global_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);
|
AK_ENUM_BITWISE_OPERATORS(Thread::FileBlocker::BlockFlags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue