Data Structures | |
struct | _NUTTHREADINFO |
Thread information structure. More... | |
struct | _NUTTHREADINFO |
Thread information structure. More... | |
struct | ENTERFRAME |
struct | SWITCHFRAME |
Typedefs | |
typedef _NUTTHREADINFO | NUTTHREADINFO |
Functions | |
void | NutThreadAddPriQueue (NUTTHREADINFO *td, NUTTHREADINFO **tqpp) |
Add a thread to a prioritiy ordered queue. | |
void | NutThreadRemoveQueue (NUTTHREADINFO *td, NUTTHREADINFO *volatile *tqpp) |
Remove a thread from a specified queue. | |
void | NutThreadResumeAsync (HANDLE th) |
Make a previously suspended thread ready to run. | |
void | NutThreadWake (HANDLE timer, HANDLE th) |
Resume a previously suspended thread. | |
void | NutThreadYield (void) |
Give up the CPU. | |
u_char | NutThreadSetPriority (u_char level) |
Set the current thread's priority. | |
HANDLE | NutThreadCreate (u_char *name, void(*fn)(void *), void *arg, u_short stackSize) |
Create a new thread. | |
Variables | |
NUTTHREADINFO *volatile | runningThread = 0 |
Currently running thread. | |
NUTTHREADINFO *volatile | nutThreadList = 0 |
List of all created threads. | |
NUTTHREADINFO *volatile | runQueue = 0 |
List of ready-to-run threads. |
|
Thread information structure type. |
|
Add a thread to a prioritiy ordered queue. Insert the thread into a specified queue behind the last thread with lower or equal priority.
|
|
Create a new thread. If the current thread's priority is lower or equal than the default priority (64), then the current thread is stopped and the new one is started.
|
|
Remove a thread from a specified queue. CPU interrupts must have been disabled before calling this function.
|
|
Make a previously suspended thread ready to run.
|
|
Set the current thread's priority. The priority of newly created threads is set to 64, but may be changed when the thread starts running. When another thread with a higher or equal priority is ready to run, the current thread will be stopped and control of the CPU is passed to the other thread. The function returns the old priority, which makes it easy to temporarily switch to another priority and later set back the old one.
|
|
Resume a previously suspended thread. This routine is called by the system when a sleep timer elapses.
|
|
Give up the CPU. If another thread within the same or higher priority is ready to run, then the current thread is stopped and the other one is started. |
|
List of all created threads. Linked list of NUTTHREADINFO structures of all threads. New threads are put in front. This list contains at least two threads, the main application thread followed by the idle thread. |
|
Currently running thread. Pointer to the NUTTHREADINFO structure of the currently running thread. |
|
List of ready-to-run threads. Priority ordered linked list of NUTTHREADINFO structures of all threads which are ready to run. |