void SetMapPointer(PriorityMap *pclMap_)
SetMapPointer Set the pointer to a bitmap to use for this threadlist. Once again, only needed when th...
static PriorityMap m_clPrioMap
Priority bitmap lookup structure, 1-bit per thread priority.
static void Add(Thread *pclThread_)
Add Add a thread to the scheduler at its current priority level.
static bool m_bEnabled
Scheduler's state - enabled or disabled.
static bool m_bQueuedSchedule
Variable representing whether or not there's a queued scheduler operation.
static ThreadList m_clStopList
ThreadList for all stopped threads.
void Remove(Thread *node_)
Remove Remove the specified thread from the threadlist.
static ThreadList m_aclPriorities[m_uNumPriorities]
ThreadLists for all threads at all priorities.
Mark3::Thread * g_pclCurrent
void SetPriority(PORT_PRIO_TYPE uXPriority_)
SetPriority Set the priority of this threadlist (if used for a scheduler).
Single include file given to users of the Mark3 Kernel API.
The Thread Class. This object providing the fundamental thread control data structures and functions ...
Mark3::Thread * g_pclNext
PriorityMapL1< PORT_PRIO_TYPE, KERNEL_NUM_PRIORITIES > PriorityMap
#define KERNEL_NUM_PRIORITIES
static void Yield(void)
Yield Yield the thread - this forces the system to call the scheduler and determine what thread shoul...
#define PANIC_NO_READY_THREADS
static void Schedule()
Schedule Run the scheduler, determines the next thread to run based on the current state of the threa...
T HighestPriority(void)
HighestPriority Computes the numeric priority of the highest-priority thread represented in the prior...
The CriticalGuard class. This class provides an implemention of RAII for critical sections...
void Add(Thread *node_)
Add Add a thread to the threadlist.
T * GetHead()
GetHead Get the head node in the linked list.
static void Init()
Init Intiailize the scheduler, must be called before use.
static void Remove(Thread *pclThread_)
Remove Remove a thread from the scheduler at its current priority level.
static constexpr auto m_uNumPriorities
PORT_PRIO_TYPE GetPriority(void)
GetPriority Return the priority of the current thread.
static void Panic(uint16_t u16Cause_)
Panic Cause the kernel to enter its panic state.
static bool SetScheduler(bool bEnable_)
SetScheduler Set the active state of the scheduler. When the scheduler is disabled, the next thread is never set; the currently running thread will run forever until the scheduler is enabled again. Care must be taken to ensure that we don't end up trying to block while the scheduler is disabled, otherwise the system ends up in an unusable state.