/* * Copyright (c) 2020, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace Kernel { class ProcessGroup : public RefCounted , public Weakable , public InlineLinkedListNode { AK_MAKE_NONMOVABLE(ProcessGroup); AK_MAKE_NONCOPYABLE(ProcessGroup); friend InlineLinkedListNode; public: ~ProcessGroup(); static RefPtr create(ProcessGroupID); static RefPtr find_or_create(ProcessGroupID); static RefPtr from_pgid(ProcessGroupID); const ProcessGroupID& pgid() const { return m_pgid; } private: ProcessGroup(ProcessGroupID pgid) : m_pgid(pgid) { } static RefPtr from_pgid_nolock(ProcessGroupID); ProcessGroup* m_prev { nullptr }; ProcessGroup* m_next { nullptr }; ProcessGroupID m_pgid; }; extern InlineLinkedList* g_process_groups; extern RecursiveSpinLock g_process_groups_lock; }