Multi-threading support. More...
Go to the source code of this file.
Data Structures | |
| struct | _NUTTHREADINFO |
| Thread information structure. More... | |
Defines | |
| #define | DEADBEEF 0xDEADBEEF |
| #define | SLEEP_MODE_NONE 0xff |
| #define | NUT_THREAD_STACK_MULT 1 |
| Stack size factor. | |
| #define | NUT_THREAD_STACK_ADD 0 |
| Stack size summand. | |
| #define | THREAD(threadfn, arg) |
| Macro for thread entry definitions. | |
Typedefs | |
| typedef struct _NUTTHREADINFO | NUTTHREADINFO |
Functions | |
| void | NutThreadInit (void) |
| Initialize thread handling in the Linux emulation. | |
| uint8_t | NutThreadSetSleepMode (uint8_t mode) |
| Sets the sleep mode to enter in Idle thread. | |
| HANDLE | NutThreadCreate (char *name, void(*fn)(void *), void *arg, size_t stackSize) |
| Create a new thread. | |
| uint8_t | NutThreadSetPriority (uint8_t level) |
| Set the current thread's priority. | |
| void | NutThreadKill (void) |
| Kill the running thread. | |
| void | NutThreadDestroy (void) |
| Free a thread that was previously killed and release memory back to the OS. | |
| void | NutThreadExit (void) |
| End the current thread. | |
| void | NutThreadResume (void) |
| Continue with the highest priority thread, which is ready to run. | |
| void | NutThreadWake (HANDLE timer, HANDLE th) |
| Resume a previously suspended thread. | |
| void | NutThreadYield (void) |
| Give up the CPU. | |
| void | NutThreadAddPriQueue (NUTTHREADINFO *td, NUTTHREADINFO *volatile *tqpp) |
| Add a thread to a prioritiy ordered queue. | |
| void | NutThreadRemoveQueue (NUTTHREADINFO *td, NUTTHREADINFO *volatile *tqpp) |
| Remove a thread from a specified queue. | |
| void | NutThreadSwitch (void) |
| Switch to another thread. | |
| HANDLE | GetThreadByName (char *name) |
| Query handle of a thread with a specific name. | |
| NUTTHREADINFO * | NutThreadStackCheck (size_t minsiz) |
| Check all Nut/OS threads for sufficient stack space. | |
| size_t | NutThreadStackAvailable (char *name) |
| Return the size of unused stack space. | |
Variables | |
| NUTTHREADINFO * | runningThread |
| Currently running thread. | |
| NUTTHREADINFO * | nutThreadList |
| List of all created threads. | |
| NUTTHREADINFO * | runQueue |
| List of ready-to-run threads. | |
Thread States | |
| #define | TDS_TERM 0 |
| #define | TDS_RUNNING 1 |
| #define | TDS_READY 2 |
| #define | TDS_SLEEP 3 |
Multi-threading support.
File version $Id: thread.h 4477 2012-08-20 17:50:01Z haraldkipp $
| #define DEADBEEF 0xDEADBEEF |
Referenced by NutDumpThreadList(), NutDumpThreadQueue(), and NutThreadCreate().