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

thread.h File Reference

Thread management definitions. More...

#include <sys/device.h>

Go to the source code of this file.

Data Structures

struct  _NUTTHREADINFO
 Thread information structure. More...


Defines

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


Typedefs

typedef _NUTTHREADINFO NUTTHREADINFO

Functions

HANDLE NutThreadCreate (u_char *name, void(*fn)(void *), void *arg, u_short stackSize)
 Create a new thread.

u_char NutThreadSetPriority (u_char level)
 Set the current thread's priority.

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.

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.


Variables

NUTTHREADINFO *volatile runningThread
 Currently running thread.

NUTTHREADINFO *volatile nutThreadList
 List of all created threads.

NUTTHREADINFO *volatile runQueue
 List of ready-to-run threads.


Detailed Description

Thread management definitions.


Define Documentation

#define THREAD threadfn,
arg   
 

Value:

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


Variable Documentation

NUTTHREADINFO* volatile nutThreadList  
 

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.

NUTTHREADINFO* volatile runningThread  
 

Currently running thread.

Pointer to the NUTTHREADINFO structure of the currently running thread.

NUTTHREADINFO* volatile runQueue  
 

List of ready-to-run threads.

Priority ordered linked list of NUTTHREADINFO structures of all threads which are ready to run.


Generated on Thu Jan 30 22:30:55 2003 for EduNet by doxygen1.2.18