DDEKit_threads


Functions

ddekit_thread_tddekit_thread_create (void(*fun)(void *), void *arg, const char *name)
 Create thread.
ddekit_thread_tddekit_thread_myself (void)
 Reference to own DDEKit thread id.
ddekit_thread_tddekit_thread_setup_myself (const char *name)
 Initialize thread with given name.
void * ddekit_thread_get_data (ddekit_thread_t *thread)
 Get TLS data for a specific thread.
void * ddekit_thread_get_my_data (void)
 Get TLS data for current thread.
void ddekit_thread_set_data (ddekit_thread_t *thread, void *data)
 Set TLS data for specific thread.
void ddekit_thread_set_my_data (void *data)
 Set TLS data for current thread.
void ddekit_thread_msleep (unsigned long msecs)
 Sleep for some miliseconds.
void ddekit_thread_usleep (unsigned long usecs)
 Sleep for some microseconds.
void ddekit_thread_nsleep (unsigned long nsecs)
 Sleep for some nanoseconds.
void ddekit_thread_sleep (ddekit_lock_t *lock)
 Sleep until a lock becomes unlocked.
void ddekit_thread_wakeup (ddekit_thread_t *thread)
 Wakeup a waiting thread.
void ddekit_thread_exit (void) __attribute__((noreturn))
 Terminate a thread.
void ddekit_thread_terminate (ddekit_thread_t *thread)
 Terminate a thread.
const char * ddekit_thread_get_name (ddekit_thread_t *thread)
 Get the name, a thread registered with DDEKit.
int ddekit_thread_get_id (ddekit_thread_t *thread)
 Get unique ID of a DDEKit thread.
void ddekit_thread_schedule (void)
 Hint that this thread is done and may be scheduled somehow.
void ddekit_yield (void)
 Hint that this thread is done and may be scheduled somehow.
void ddekit_init_threads (void)
 Initialize DDEKit thread subsystem.

Function Documentation

void ddekit_init_threads ( void   ) 

Initialize DDEKit thread subsystem.

Definition at line 186 of file thread.c.

ddekit_thread_t* ddekit_thread_create ( void(*)(void *)  fun,
void *  arg,
const char *  name 
)

Create thread.

Create a new thread running the specified thread function with the specified arguments. The thread is assigned the given internal name.

Additionally, DDEKit threads possess a thread-local storage area where they may store arbitrary data.

Parameters:
fun thread function
arg optional argument to thread function, set to NULL if not needed
name internal thread name

Definition at line 75 of file thread.c.

void ddekit_thread_exit ( void   ) 

Terminate a thread.

Definition at line 151 of file thread.c.

void* ddekit_thread_get_data ( ddekit_thread_t thread  ) 

Get TLS data for a specific thread.

Returns:
Pointer to TLS data of this thread.

Definition at line 118 of file thread.c.

int ddekit_thread_get_id ( ddekit_thread_t thread  ) 

Get unique ID of a DDEKit thread.

DDEKit does not allow direct access to the thread data structure, since this struct contains L4-specific data types. However, applications might want to get some kind of ID related to a ddekit_thread, for instance to use it as a Linux-like PID.

Definition at line 171 of file thread.c.

void* ddekit_thread_get_my_data ( void   ) 

Get TLS data for current thread.

Same as calling ddekit_thread_get_data with ddekit_thread_myself as parameter.

Returns:
Pointer to TLS data of current thread.

Definition at line 122 of file thread.c.

const char* ddekit_thread_get_name ( ddekit_thread_t thread  ) 

Get the name, a thread registered with DDEKit.

Definition at line 167 of file thread.c.

void ddekit_thread_msleep ( unsigned long  msecs  ) 

Sleep for some miliseconds.

Parameters:
msecs time to sleep in ms.

Definition at line 126 of file thread.c.

ddekit_thread_t* ddekit_thread_myself ( void   ) 

Reference to own DDEKit thread id.

Definition at line 106 of file thread.c.

void ddekit_thread_nsleep ( unsigned long  nsecs  ) 

Sleep for some nanoseconds.

Parameters:
usecs time to sleep in ns.

Definition at line 135 of file thread.c.

void ddekit_thread_schedule ( void   ) 

Hint that this thread is done and may be scheduled somehow.

Definition at line 176 of file thread.c.

void ddekit_thread_set_data ( ddekit_thread_t thread,
void *  data 
)

Set TLS data for specific thread.

Parameters:
thread DDEKit thread
data pointer to thread data

Definition at line 110 of file thread.c.

void ddekit_thread_set_my_data ( void *  data  ) 

Set TLS data for current thread.

Parameters:
data pointer to thread data

Definition at line 114 of file thread.c.

ddekit_thread_t* ddekit_thread_setup_myself ( const char *  name  ) 

Initialize thread with given name.

This function may be used by threads that were not created using ddekit_thread_create. This enables such threads to be handled as if they were DDEKit threads.

Definition at line 39 of file thread.c.

void ddekit_thread_sleep ( ddekit_lock_t lock  ) 

Sleep until a lock becomes unlocked.

Definition at line 139 of file thread.c.

void ddekit_thread_terminate ( ddekit_thread_t thread  ) 

Terminate a thread.

Definition at line 162 of file thread.c.

void ddekit_thread_usleep ( unsigned long  usecs  ) 

Sleep for some microseconds.

Parameters:
usecs time to sleep in µs.

Definition at line 130 of file thread.c.

void ddekit_thread_wakeup ( ddekit_thread_t thread  ) 

Wakeup a waiting thread.

Definition at line 147 of file thread.c.

void ddekit_yield ( void   ) 

Hint that this thread is done and may be scheduled somehow.

Definition at line 181 of file thread.c.


Generated on Wed Apr 11 06:39:16 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6