Nut/OS  5.0.5
API Reference
thread.h File Reference

Multi-threading support. More...

#include <compiler.h>
#include <sys/types.h>
#include <cfg/memory.h>
#include <stdint.h>
Include dependency graph for thread.h:

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.
NUTTHREADINFONutThreadStackCheck (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

NUTTHREADINFOrunningThread
 Currently running thread.
NUTTHREADINFOnutThreadList
 List of all created threads.
NUTTHREADINFOrunQueue
 List of ready-to-run threads.

Thread States

#define TDS_TERM   0
#define TDS_RUNNING   1
#define TDS_READY   2
#define TDS_SLEEP   3

Detailed Description

Multi-threading support.

File version $Id: thread.h 4477 2012-08-20 17:50:01Z haraldkipp $ 

Define Documentation

#define DEADBEEF   0xDEADBEEF