Mark3::Thread * g_pclNext
static PriorityMap m_clPrioMap
Priority bitmap lookup structure, 1-bit per thread priority.
Basic data type primatives used throughout the OS.
static bool IsEnabled()
IsEnabled Return the current state of the scheduler - whether or not scheudling is enabled or disable...
static ThreadList * GetStopList()
GetStopList Return the pointer to the list of threads that are in the scheduler's stopped state...
static void Add(Thread *pclThread_)
Add Add a thread to the scheduler at its current priority level.
Thread porting interface.
The ThreadList Class. This class is used for building thread-management facilities, such as schedulers, and blocking objects.
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.
#define PORT_PRIO_TYPE
Type used for bitmap in the PriorityMap class.
static ThreadList * GetThreadList(PORT_PRIO_TYPE uXPriority_)
GetThreadList Return the pointer to the active list of threads that are at the given priority level i...
static ThreadList m_clStopList
ThreadList for all stopped threads.
static ThreadList m_aclPriorities[m_uNumPriorities]
ThreadLists for all threads at all priorities.
Platform independent thread class declarations Threads are an atomic unit of execution, and each instance of the thread class represents an instance of a program running of the processor. The Thread is the fundmanetal user-facing object in the kernel - it is what makes multiprocessing possible from application code.
static void QueueScheduler()
QueueScheduler Tell the kernel to perform a scheduling operation as soon as the scheduler is re-enabl...
The Thread Class. This object providing the fundamental thread control data structures and functions ...
The Scheduler Class. This class provides priority-based round-robin Thread scheduling for all active ...
#define KERNEL_NUM_PRIORITIES
Priority map data structure.
The PriorityMapL1 class This class implements a priority bitmap data structure. Each bit in the objec...
static void Schedule()
Schedule Run the scheduler, determines the next thread to run based on the current state of the threa...
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
static Thread * GetCurrentThread()
GetCurrentThread Return the pointer to the currently-running thread.
static volatile Thread * GetNextThread()
GetNextThread Return the pointer to the thread that should run next, according to the last run of the...
Mark3::Thread * g_pclCurrent
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.