gwion-util
utilities for the Gwion project
|
cross-platform thread functions More...
#include <pthread.h>
#include <dlfcn.h>
Go to the source code of this file.
Macros | |
#define | THREAD_RETTYPE void * |
#define | THREAD_FUNC(a) THREAD_RETTYPE(a)(void *data) |
#define | THREAD_TYPE pthread_t |
#define | THREAD_CREATE(thread, func, arg) pthread_create(&thread, NULL, func, arg) |
#define | THREAD_JOIN(thread) pthread_join(thread, NULL) |
#define | THREAD_RETURN(arg) |
#define | THREAD_DETACH(arg) pthread_detach(arg) |
#define | MUTEX_TYPE pthread_mutex_t * |
#define | MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
#define | MUTEX_SETUP(x) |
#define | MUTEX_CLEANUP(x) |
#define | MUTEX_LOCK(x) pthread_mutex_lock((x)) |
#define | MUTEX_COND_LOCK(x) pthread_mutex_lock((x)) |
#define | MUTEX_UNLOCK(x) pthread_mutex_unlock((x)) |
#define | MUTEX_COND_UNLOCK(x) pthread_mutex_unlock((x)) |
#define | THREAD_COND_TYPE pthread_cond_t* |
#define | THREAD_COND_SETUP(x) |
#define | THREAD_COND_WAIT(x, mutex) pthread_cond_wait(x, mutex) |
#define | THREAD_COND_SIGNAL(x) pthread_cond_signal(x) |
#define | THREAD_COND_BROADCAST(x) pthread_cond_broadcast(x) |
#define | THREAD_COND_CLEANUP(x) |
#define | STR_EXPAND(tok) #tok |
#define | STR(tok) STR_EXPAND(tok) |
#define | DLOPEN(dl, b) dlopen(dl, b) |
#define | DLSYM(dl, t, a) (t)(intptr_t) dlsym(dl, a) |
#define | DLCLOSE(dl) dlclose(dl) |
#define | DLERROR() dlerror() |
cross-platform thread functions
Definition in file gwion_thread.h.
#define DLCLOSE | ( | dl | ) | dlclose(dl) |
Definition at line 93 of file gwion_thread.h.
#define DLERROR | ( | ) | dlerror() |
Definition at line 94 of file gwion_thread.h.
#define DLOPEN | ( | dl, | |
b ) dlopen(dl, b) |
Definition at line 91 of file gwion_thread.h.
#define DLSYM | ( | dl, | |
t, | |||
a ) (t)(intptr_t) dlsym(dl, a) |
Definition at line 92 of file gwion_thread.h.
#define MUTEX_CLEANUP | ( | x | ) |
Definition at line 60 of file gwion_thread.h.
#define MUTEX_COND_LOCK | ( | x | ) | pthread_mutex_lock((x)) |
Definition at line 66 of file gwion_thread.h.
#define MUTEX_COND_UNLOCK | ( | x | ) | pthread_mutex_unlock((x)) |
Definition at line 68 of file gwion_thread.h.
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
Definition at line 51 of file gwion_thread.h.
#define MUTEX_LOCK | ( | x | ) | pthread_mutex_lock((x)) |
Definition at line 65 of file gwion_thread.h.
#define MUTEX_SETUP | ( | x | ) |
Definition at line 52 of file gwion_thread.h.
#define MUTEX_TYPE pthread_mutex_t * |
Definition at line 50 of file gwion_thread.h.
#define MUTEX_UNLOCK | ( | x | ) | pthread_mutex_unlock((x)) |
Definition at line 67 of file gwion_thread.h.
#define STR | ( | tok | ) | STR_EXPAND(tok) |
Definition at line 88 of file gwion_thread.h.
#define STR_EXPAND | ( | tok | ) | #tok |
Definition at line 87 of file gwion_thread.h.
#define THREAD_COND_BROADCAST | ( | x | ) | pthread_cond_broadcast(x) |
Definition at line 78 of file gwion_thread.h.
#define THREAD_COND_CLEANUP | ( | x | ) |
Definition at line 79 of file gwion_thread.h.
#define THREAD_COND_SETUP | ( | x | ) |
Definition at line 71 of file gwion_thread.h.
#define THREAD_COND_SIGNAL | ( | x | ) | pthread_cond_signal(x) |
Definition at line 77 of file gwion_thread.h.
#define THREAD_COND_TYPE pthread_cond_t* |
Definition at line 70 of file gwion_thread.h.
#define THREAD_COND_WAIT | ( | x, | |
mutex ) pthread_cond_wait(x, mutex) |
Definition at line 76 of file gwion_thread.h.
Definition at line 40 of file gwion_thread.h.
Definition at line 48 of file gwion_thread.h.
#define THREAD_FUNC | ( | a | ) | THREAD_RETTYPE(a)(void *data) |
Definition at line 38 of file gwion_thread.h.
#define THREAD_JOIN | ( | thread | ) | pthread_join(thread, NULL) |
Definition at line 42 of file gwion_thread.h.
#define THREAD_RETTYPE void * |
Definition at line 37 of file gwion_thread.h.
#define THREAD_RETURN | ( | arg | ) |
Definition at line 43 of file gwion_thread.h.
#define THREAD_TYPE pthread_t |
Definition at line 39 of file gwion_thread.h.