void InitScheduler( void ) |
explained below |
void KillThread( Thread * ) |
explained below |
void KillCurrentThread( int inttype ) |
explained below |
void NextThread( int inttype ) |
explained below |
void WakeUpThreadMsg( Thread *current, Threda *dest, int payload, int send ) |
explained below |
Look at the header file: scheduler.e
void InitScheduler( void ) |
Initialise the idle state_t in the kernel data. |
void Idle( void ) |
This function starts every time there are no ready threads to run. It checks whether the kernel has reached a deadlock condition (ie. no waiting threads or no thread is waiting for a timing message or IO interrupt) and if so it prints an error message and halts the machine. Otherwise, it enters a loop which will keep the CPU busy waiting for the next interrupt. |
void KillThread( Thread * ) |
Kills the given thread. All the children of the thread will be terminated as well. |
void KillCurrentThread( int inttype ) |
It simply kills the running thread and starts the successive one.
|
void NextThread( int inttype ) |
Starts the first thread in the ready queue. If this is empty, the
Idle() routine will be run.
|
void WakeUpThreadMsg( Thread *current, Threda *dest, int payload, int send ) |
This function wakes up a thread blocked by a MsgRecv().
If |
Look at the code: scheduler.cc