Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

thread.h File Reference


Detailed Description

Thread management definitions.


Defines

#define DEADBEEF   0xDEADBEEF
#define TDS_TERM   0
#define TDS_RUNNING   1
#define TDS_READY   2
#define TDS_SLEEP   3
#define SLEEP_MODE_NONE   0xff
#define THREAD(threadfn, arg)
 Macro for thread entry definitions.

Typedefs

typedef _NUTTHREADINFO NUTTHREADINFO

Functions

void NutThreadSetSleepMode (u_char mode)
 Sets the sleep mode to enter in Idle thread.
HANDLE NutThreadCreate (u_char *name, void(*fn)(void *), void *arg, size_t stackSize)
 Create a new thread.
u_char NutThreadSetPriority (u_char 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 **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 (u_char *name)
void DumpThreads (HANDLE handle)
void * NutStackAlloc (size_t size)
int NutStackFree (void *block)
void NutStackAdd (void *addr, size_t size)

Variables

NUTTHREADINFOrunningThread
 Currently running thread.
NUTTHREADINFOnutThreadList
 List of all created threads.
NUTTHREADINFO *volatile readyQueue
 List of threads to resume.
NUTTHREADINFOrunQueue
 List of ready-to-run threads.


Define Documentation

#define THREAD threadfn,
arg   ) 
 

Value:

void threadfn(void *arg) __attribute__ ((noreturn)); \
void threadfn(void *arg)
Macro for thread entry definitions.

Examples:
events/events.c, ftpd/ftpserv.c, httpd/httpserv.c, portdio/portdio.c, threads/threads.c, and timers/timers.c.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/