|
The Pedigree Project 0.1
|
#include <SchedulerTimerHandlerSlot.h>
Collaboration diagram for SchedulerTimerHandlerSlot:Classes | |
| class | DispatchGuard |
Public Member Functions | |
| bool | publish (size_t owner, SchedulerTimerHandler *handler) |
| bool | unpublish (size_t owner, SchedulerTimerHandler *handler) |
| bool | beginDispatch (size_t owner, DispatchGuard &guard) |
| bool | isPublished (size_t owner, SchedulerTimerHandler *handler) const |
| size_t | activeDispatches () const |
Static Public Attributes | |
| static constexpr size_t | NoOwner = ~static_cast<size_t>(0) |
Private Types | |
| enum | State : size_t { Empty , Publishing , Published , Removing } |
Private Member Functions | |
| SchedulerTimerHandlerSlot (const SchedulerTimerHandlerSlot &)=delete | |
| SchedulerTimerHandlerSlot & | operator= (const SchedulerTimerHandlerSlot &)=delete |
| void | completeDispatch () |
Private Attributes | |
| SchedulerTimerHandler * | m_Handler |
| size_t | m_Owner |
| size_t | m_State |
Static Private Attributes | |
| static constexpr size_t | ModeMask = 3 |
| static constexpr size_t | DispatchIncrement = ModeMask + 1 |
| static constexpr size_t | DispatchCountMask = ~ModeMask |
Lock-free, processor-owned publication for a hard scheduler-timer callback.
A scheduler timer invokes only the handler owned by the processor which received the tick. A callback may context-switch away with its interrupt frame still suspended, so admission is counted rather than exclusive. Removal succeeds only when it can close an idle publication; it never waits on a callback which needs this same processor to run again.
Definition at line 29 of file SchedulerTimerHandlerSlot.h.
|
private |
Definition at line 180 of file SchedulerTimerHandlerSlot.h.
|
inline |
Definition at line 71 of file SchedulerTimerHandlerSlot.h.
|
inline |
Lock-free diagnostic count of admitted, not-yet-returned callbacks.
Definition at line 166 of file SchedulerTimerHandlerSlot.h.
|
inline |
Admit one callback and bind its lifetime to the supplied guard.
Definition at line 120 of file SchedulerTimerHandlerSlot.h.
Referenced by LocalApicTimerHandlerSlots::beginDispatch().
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 196 of file SchedulerTimerHandlerSlot.h.
|
inline |
Test/diagnostic predicate which never exposes a callback pointer.
Definition at line 156 of file SchedulerTimerHandlerSlot.h.
Referenced by LocalApicTimerHandlerSlots::isPublished().
Here is the caller graph for this function:
|
inline |
Publish only when the slot has no owner, including no duplicate owner.
Definition at line 74 of file SchedulerTimerHandlerSlot.h.
Referenced by LocalApicTimerHandlerSlots::registerHandler(), HostedSchedulerTimer::registerHandler(), and Pit::registerHandler().
Here is the caller graph for this function:
|
inline |
Unpublish only when handler belongs to the calling processor.
A true return is a callback-lifetime barrier: this processor cannot concurrently execute its timer hard frame, and future frames reject the closing slot before loading the callback pointer.
Definition at line 97 of file SchedulerTimerHandlerSlot.h.
Referenced by LocalApicTimerHandlerSlots::removeHandler(), HostedSchedulerTimer::removeHandler(), and Pit::removeHandler().
Here is the caller graph for this function:
|
staticconstexprprivate |
Definition at line 189 of file SchedulerTimerHandlerSlot.h.
|
staticconstexprprivate |
Definition at line 188 of file SchedulerTimerHandlerSlot.h.
|
private |
Definition at line 203 of file SchedulerTimerHandlerSlot.h.
|
private |
Definition at line 204 of file SchedulerTimerHandlerSlot.h.
|
private |
Definition at line 205 of file SchedulerTimerHandlerSlot.h.
|
staticconstexprprivate |
Definition at line 187 of file SchedulerTimerHandlerSlot.h.
|
staticconstexpr |
Definition at line 31 of file SchedulerTimerHandlerSlot.h.