#include <Thread.h>
Inheritance diagram for Thread:
Public Member Functions | |
Thread (char *name, int stackSize, int priority, int id) | |
bool | spawn () |
void | ready () |
void | suspend () |
void | kill () |
Protected Member Functions | |
void | reschedule () |
void | sleep (int hundrethSeconds) |
Static Protected Member Functions | |
void | run () |
Protected Attributes | |
tcb * | threadControlBlock |
char * | name |
int | stackSize |
int | priority |
int | id |
|
Constructor for Thread
|
|
The thread is removed and cannot be used anymore |
|
Sets the status of the thread to READY, i.e. it is scheduled for execution |
|
Tells the scheduler to choose another thread for execution |
|
The method is overwritten by the inheritor. When the thread starts the code in this run method is executed |
|
Let the thread sleep for at least n hundreth seconds
|
|
The thread is initialized and inserted in scheduler queue but not set to READY yet
|
|
The status of the thread is set to SUSPENDED. It will not be scheduled for execution anymore until it is set to READY again
|
|
|
|
|
|
|
|
|
|
Thread control blocks are used by the RoBIOS library to manage threads. This Thread class handles the thread control block internally thus hiding complexity from the user |