The Pedigree Project
0.1
src
system
include
pedigree
kernel
process
TerminationDeferral.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_TERMINATIONDEFERRAL_H
9
#define PEDIGREE_KERNEL_PROCESS_TERMINATIONDEFERRAL_H
10
#include "pedigree/kernel/compiler.h"
11
#include "pedigree/kernel/process/DeferredScope.h"
12
13
#include <config.h>
14
15
class
Thread
;
16
27
class
EXPORTED_PUBLIC
TerminationDeferral
{
28
public
:
29
// Keep the fresh-record constructor visible to avoid a redundant automatic
30
// stack fill before initialise() writes every field and publishes it.
31
explicit
ALWAYS_INLINE
TerminationDeferral
(
bool
active =
true
)
32
: m_pThread(
nullptr
), m_Record(
DeferredScopeRecord::Uninitialised
{}) {
33
initialise(active);
34
}
35
TerminationDeferral
(
TerminationDeferral
&& other)
noexcept
;
36
~TerminationDeferral
();
37
38
TerminationDeferral
& operator=(
TerminationDeferral
&& other)
noexcept
;
39
40
private
:
41
void
initialise(
bool
active);
42
43
TerminationDeferral
(
const
TerminationDeferral
&) =
delete
;
44
TerminationDeferral
& operator=(
const
TerminationDeferral
&) =
delete
;
45
46
Thread
* m_pThread;
47
DeferredScopeRecord
m_Record;
48
};
49
50
#endif
TerminationDeferral
Definition
TerminationDeferral.h:27
Thread
Definition
Thread.h:75
ALWAYS_INLINE
#define ALWAYS_INLINE
Definition
system/include/pedigree/kernel/compiler.h:42
DeferredScopeRecord::Uninitialised
Definition
DeferredScope.h:45
DeferredScopeRecord
Definition
DeferredScope.h:21
Generated on Tue Sep 22 2026 06:05:49 for The Pedigree Project by
1.9.8