|
The Pedigree Project 0.1
|
#include <Completion.h>
Collaboration diagram for Completion:Public Member Functions | |
| MUST_USE_RESULT bool | wait (WaitQueue::StackDiscardCleanup onStackDiscard=nullptr, void *stackDiscardContext=nullptr) |
| bool | complete () |
| bool | isComplete () |
Private Member Functions | |
| NOT_COPYABLE_OR_ASSIGNABLE (Completion) | |
Private Attributes | |
| WaitQueue | m_Waiters |
| bool | m_Completed |
| bool | m_WaitClaimed |
A one-shot, latched completion with an exactly-once wait claim.
complete() may run before or after wait(), including from interrupt context. Repeated completion attempts are ignored. A second call to wait() is a contract violation instead of an unexplained permanent block.
Definition at line 22 of file Completion.h.
| Completion::Completion | ( | ) |
Definition at line 12 of file Completion.cc.
| bool Completion::complete | ( | ) |
Latches completion and wakes the waiter.
Definition at line 43 of file Completion.cc.
Referenced by PosixSubsystem::threadRemoved().
Here is the caller graph for this function:| bool Completion::isComplete | ( | ) |
Definition at line 54 of file Completion.cc.
| bool Completion::wait | ( | WaitQueue::StackDiscardCleanup | onStackDiscard = nullptr, |
| void * | stackDiscardContext = nullptr |
||
| ) |
Waits for completion.
A Completion has exactly one wait operation in its lifetime. A pending terminal request returns false after retiring the wait record; caller-owned state can therefore be released by ordinary scope cleanup. onStackDiscard is only a best-effort safety hook for an explicitly discarded physical stack.
Definition at line 16 of file Completion.cc.
|
private |
Definition at line 52 of file Completion.h.
|
private |
Definition at line 53 of file Completion.h.
|
private |
Definition at line 51 of file Completion.h.