Functions | |
| ddekit_thread_t * | ddekit_thread_create (void(*fun)(void *), void *arg, const char *name) |
| Create thread. | |
| ddekit_thread_t * | ddekit_thread_myself (void) |
| Reference to own DDEKit thread id. | |
| ddekit_thread_t * | ddekit_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. | |
| void ddekit_init_threads | ( | void | ) |
| 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.
| fun | thread function | |
| arg | optional argument to thread function, set to NULL if not needed | |
| name | internal thread name |
| void* ddekit_thread_get_data | ( | ddekit_thread_t * | thread | ) |
| 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.
| 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.
| const char* ddekit_thread_get_name | ( | ddekit_thread_t * | thread | ) |
| void ddekit_thread_msleep | ( | unsigned long | msecs | ) |
| ddekit_thread_t* ddekit_thread_myself | ( | void | ) |
| void ddekit_thread_nsleep | ( | unsigned long | nsecs | ) |
| void ddekit_thread_schedule | ( | void | ) |
| void ddekit_thread_set_data | ( | ddekit_thread_t * | thread, | |
| void * | data | |||
| ) |
| void ddekit_thread_set_my_data | ( | void * | data | ) |
| 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.
| void ddekit_thread_sleep | ( | ddekit_lock_t * | lock | ) |
| void ddekit_thread_terminate | ( | ddekit_thread_t * | thread | ) |
| void ddekit_thread_usleep | ( | unsigned long | usecs | ) |
| void ddekit_thread_wakeup | ( | ddekit_thread_t * | thread | ) |
| void ddekit_yield | ( | void | ) |
1.5.6