Kernel: Make ProcessGroup::find_or_create API OOM safe

Make ProcessGroup::find_or_create & ProcessGroup::create OOM safe, by
moving to adopt_ref_if_nonnull.
This commit is contained in:
Brian Gianforcaro 2021-05-18 02:07:25 -07:00 committed by Andreas Kling
commit bb91bed576
Notes: sideshowbarker 2024-07-18 17:43:49 +09:00
3 changed files with 9 additions and 6 deletions

View file

@ -28,8 +28,8 @@ class ProcessGroup
public:
~ProcessGroup();
static NonnullRefPtr<ProcessGroup> create(ProcessGroupID);
static NonnullRefPtr<ProcessGroup> find_or_create(ProcessGroupID);
static RefPtr<ProcessGroup> create(ProcessGroupID);
static RefPtr<ProcessGroup> find_or_create(ProcessGroupID);
static RefPtr<ProcessGroup> from_pgid(ProcessGroupID);
const ProcessGroupID& pgid() const { return m_pgid; }