|
The Pedigree Project 0.1
|
#include <AdmittedThread.h>
Collaboration diagram for AdmittedThread:Classes | |
| struct | Context |
Public Types | |
| using | Entry = int(*)(void *) |
| using | Cancel = void(*)(void *) |
Static Public Member Functions | |
| static MUST_USE_RESULT bool | launchDetached (Entry entry, void *parameter, Cancel cancel, OperationBarrier &barrier, const char *name=nullptr) |
Static Private Member Functions | |
| static void | cancelBeforeStart (void *parameter) |
| static int | trampoline (void *parameter) |
Runs module or subsystem work behind a kernel-resident admission boundary.
The worker is published as a detached Thread. Its entry point may live in unloadable module text, but the admission is released only after that entry point has returned to the kernel trampoline. On success ownership of parameter transfers to entry, or to cancel if the scheduler retires the worker before entry begins. On failure neither is called and the caller retains parameter. An explicit physical stack discard cannot return through the trampoline, so it intentionally leaks the admission and blocks teardown. The producer must itself be stopped or joined before the barrier is drained; admission protects entry and cancel, not the producer's module frame. A cancel callback runs on the scheduler's ordinary add worker and must not wait for new thread publication on that CPU or drain the same barrier whose admission it holds. A null cancel leaves parameter externally owned if entry never begins.
Definition at line 33 of file AdmittedThread.h.
| using AdmittedThread::Cancel = void (*)(void*) |
Definition at line 36 of file AdmittedThread.h.
| using AdmittedThread::Entry = int (*)(void*) |
Definition at line 35 of file AdmittedThread.h.
|
staticprivate |
Definition at line 84 of file AdmittedThread.cc.
|
static |
False means no Thread was published and the caller still owns parameter.
Definition at line 37 of file AdmittedThread.cc.
References Scheduler::instance(), panic(), Thread::startDetached(), and OperationBarrier::tryAcquire().
|
staticprivate |
Definition at line 92 of file AdmittedThread.cc.