The Pedigree Project 0.1
Completion.h
1/*
2 * Copyright (c) 2026, Pedigree Developers
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted.
6 */
7
8#ifndef PEDIGREE_KERNEL_PROCESS_COMPLETION_H
9#define PEDIGREE_KERNEL_PROCESS_COMPLETION_H
10#include "pedigree/kernel/compiler.h"
11#include "pedigree/kernel/process/WaitQueue.h"
12
13#include <config.h>
14
22class EXPORTED_PUBLIC Completion {
23 public:
24 Completion();
26
36 MUST_USE_RESULT bool wait(WaitQueue::StackDiscardCleanup onStackDiscard = nullptr,
37 void* stackDiscardContext = nullptr);
38
44 bool complete();
45
46 bool isComplete();
47
48 private:
49 NOT_COPYABLE_OR_ASSIGNABLE(Completion);
50
51 WaitQueue m_Waiters;
52 bool m_Completed;
53 bool m_WaitClaimed;
54};
55
56#endif