1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

Kernel: Switch ProcessGroup to IntrusiveList from InlineLinkedList

This commit is contained in:
Brian Gianforcaro 2021-06-03 03:21:04 -07:00 committed by Andreas Kling
parent ce74fce0df
commit 7e691f96e1
3 changed files with 11 additions and 13 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/InlineLinkedList.h>
#include <AK/IntrusiveList.h>
#include <AK/RefCounted.h>
#include <AK/Weakable.h>
#include <Kernel/Lock.h>
@ -17,14 +17,11 @@ namespace Kernel {
class ProcessGroup
: public RefCounted<ProcessGroup>
, public Weakable<ProcessGroup>
, public InlineLinkedListNode<ProcessGroup> {
, public Weakable<ProcessGroup> {
AK_MAKE_NONMOVABLE(ProcessGroup);
AK_MAKE_NONCOPYABLE(ProcessGroup);
friend InlineLinkedListNode<ProcessGroup>;
public:
~ProcessGroup();
@ -40,13 +37,14 @@ private:
{
}
ProcessGroup* m_prev { nullptr };
ProcessGroup* m_next { nullptr };
IntrusiveListNode<ProcessGroup> m_list_node;
ProcessGroupID m_pgid;
public:
using List = IntrusiveList<ProcessGroup, RawPtr<ProcessGroup>, &ProcessGroup::m_list_node>;
};
extern InlineLinkedList<ProcessGroup>* g_process_groups;
extern ProcessGroup::List* g_process_groups;
extern RecursiveSpinLock g_process_groups_lock;
}