/* * Copyright (c) 2020, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Kernel { class ProcessGroup : public AtomicRefCounted , public LockWeakable { AK_MAKE_NONMOVABLE(ProcessGroup); AK_MAKE_NONCOPYABLE(ProcessGroup); public: ~ProcessGroup(); static ErrorOr> try_create(ProcessGroupID); static ErrorOr> try_find_or_create(ProcessGroupID); static LockRefPtr from_pgid(ProcessGroupID); ProcessGroupID const& pgid() const { return m_pgid; } private: ProcessGroup(ProcessGroupID pgid) : m_pgid(pgid) { } IntrusiveListNode m_list_node; ProcessGroupID m_pgid; public: using List = IntrusiveList<&ProcessGroup::m_list_node>; }; SpinlockProtected& process_groups(); }