The Scheduler Class. This class provides priority-based round-robin Thread scheduling for all active threads managed by the kernel.
More...
#include <scheduler.h>
|
static void | Init () |
| Init Intiailize the scheduler, must be called before use. More...
|
|
static void | Schedule () |
| Schedule Run the scheduler, determines the next thread to run based on the current state of the threads. Note that the next-thread chosen from this function is only valid while in a critical section. More...
|
|
static void | Add (Thread *pclThread_) |
| Add Add a thread to the scheduler at its current priority level. More...
|
|
static void | Remove (Thread *pclThread_) |
| Remove Remove a thread from the scheduler at its current priority level. More...
|
|
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. More...
|
|
static Thread * | GetCurrentThread () |
| GetCurrentThread Return the pointer to the currently-running thread. More...
|
|
static volatile Thread * | GetNextThread () |
| GetNextThread Return the pointer to the thread that should run next, according to the last run of the scheduler. More...
|
|
static ThreadList * | GetThreadList (PORT_PRIO_TYPE uXPriority_) |
| GetThreadList Return the pointer to the active list of threads that are at the given priority level in the scheduler. More...
|
|
static ThreadList * | GetStopList () |
| GetStopList Return the pointer to the list of threads that are in the scheduler's stopped state. More...
|
|
static bool | IsEnabled () |
| IsEnabled Return the current state of the scheduler - whether or not scheudling is enabled or disabled. More...
|
|
static void | QueueScheduler () |
| QueueScheduler Tell the kernel to perform a scheduling operation as soon as the scheduler is re-enabled. More...
|
|
The Scheduler Class. This class provides priority-based round-robin Thread scheduling for all active threads managed by the kernel.
Definition at line 63 of file scheduler.h.
◆ Add()
void Mark3::Scheduler::Add |
( |
Thread * |
pclThread_ | ) |
|
|
static |
Add Add a thread to the scheduler at its current priority level.
- Parameters
-
pclThread_ | Pointer to the thread to add to the scheduler |
Definition at line 59 of file scheduler.cpp.
◆ GetCurrentThread()
static Thread* Mark3::Scheduler::GetCurrentThread |
( |
| ) |
|
|
inlinestatic |
◆ GetNextThread()
static volatile Thread* Mark3::Scheduler::GetNextThread |
( |
| ) |
|
|
inlinestatic |
GetNextThread Return the pointer to the thread that should run next, according to the last run of the scheduler.
- Returns
- Pointer to the next-running thread
Definition at line 124 of file scheduler.h.
◆ GetStopList()
static ThreadList* Mark3::Scheduler::GetStopList |
( |
| ) |
|
|
inlinestatic |
GetStopList Return the pointer to the list of threads that are in the scheduler's stopped state.
- Returns
- Pointer to the ThreadList containing the stopped threads
Definition at line 142 of file scheduler.h.
◆ GetThreadList()
GetThreadList Return the pointer to the active list of threads that are at the given priority level in the scheduler.
- Parameters
-
uXPriority_ | Priority level of the threadlist |
- Returns
- Pointer to the ThreadList for the given priority level
Definition at line 134 of file scheduler.h.
◆ Init()
void Mark3::Scheduler::Init |
( |
void |
| ) |
|
|
static |
Init Intiailize the scheduler, must be called before use.
Definition at line 36 of file scheduler.cpp.
◆ IsEnabled()
static bool Mark3::Scheduler::IsEnabled |
( |
| ) |
|
|
inlinestatic |
IsEnabled Return the current state of the scheduler - whether or not scheudling is enabled or disabled.
- Returns
- true - scheduler enabled, false - disabled
Definition at line 150 of file scheduler.h.
◆ QueueScheduler()
static void Mark3::Scheduler::QueueScheduler |
( |
| ) |
|
|
inlinestatic |
QueueScheduler Tell the kernel to perform a scheduling operation as soon as the scheduler is re-enabled.
Definition at line 156 of file scheduler.h.
◆ Remove()
void Mark3::Scheduler::Remove |
( |
Thread * |
pclThread_ | ) |
|
|
static |
Remove Remove a thread from the scheduler at its current priority level.
- Parameters
-
pclThread_ | Pointer to the thread to be removed from the scheduler |
Definition at line 67 of file scheduler.cpp.
◆ Schedule()
void Mark3::Scheduler::Schedule |
( |
| ) |
|
|
static |
Schedule Run the scheduler, determines the next thread to run based on the current state of the threads. Note that the next-thread chosen from this function is only valid while in a critical section.
Definition at line 45 of file scheduler.cpp.
◆ SetScheduler()
bool Mark3::Scheduler::SetScheduler |
( |
bool |
bEnable_ | ) |
|
|
static |
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.
- Parameters
-
bEnable_ | true to enable, false to disable the scheduler |
Definition at line 75 of file scheduler.cpp.
◆ m_aclPriorities
ThreadLists for all threads at all priorities.
Definition at line 171 of file scheduler.h.
◆ m_bEnabled
bool Mark3::Scheduler::m_bEnabled |
|
staticprivate |
◆ m_bQueuedSchedule
bool Mark3::Scheduler::m_bQueuedSchedule |
|
staticprivate |
Variable representing whether or not there's a queued scheduler operation.
Definition at line 165 of file scheduler.h.
◆ m_clPrioMap
Priority bitmap lookup structure, 1-bit per thread priority.
Definition at line 174 of file scheduler.h.
◆ m_clStopList
◆ m_uNumPriorities
The documentation for this class was generated from the following files: