17 pthread_mutex_t mutex;
95 extern void mutex_init(pthread_mutex_t *restrict mutex,
const pthread_mutexattr_t *restrict attr);
102 extern void mutex_lock(pthread_mutex_t *mutex);
126 extern void thread_new(pthread_t *thread,
const pthread_attr_t *attr,
void *(*handle)(
void *),
void *arg);
141 extern void thread_join(pthread_t thread,
void **retval);
151 extern void attr_init(pthread_attr_t *attr);
152 extern void attr_destory(pthread_attr_t *attr);
void * cu_join(thread_t *thread)
Join a thread.
void thread_exit(void *retval)
Wrapper around pthread_exit()
void mutex_unlock(pthread_mutex_t *mutex)
Wrapper around pthread_mutex_unlock() with error handling.
thread_t cu_thread_new(void *(*handle)(), void *args)
Create a thread_t structur.
void mutex_destroy(pthread_mutex_t *mutex)
Wrapper around pthread_mutex_destroy() with error handling.
void mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr)
Wrapper around pthread_mutex_init() with error handling.
void thread_join(pthread_t thread, void **retval)
Wrapper around pthread_join() with error handling.
void mutex_lock(pthread_mutex_t *mutex)
Wrapper around pthread_mutex_lock() with error handling.
void * cu_lock(mutex_t *mutex)
lock the mutex and get access to the data
void thread_new(pthread_t *thread, const pthread_attr_t *attr, void *(*handle)(void *), void *arg)
Wrapper around pthread_thread_create() with error handling.
mutex_t cu_mutex_new(void *inner)
Initialize a CU mutex.
void cu_unlock(mutex_t *mutex)
Unlock a mutex_t object.
void thread_cancel(pthread_t thread)
Wrapper around pthread_cancel() with error handling.
void cu_mutex_del(mutex_t *mutex, void(*del)(void *))
Destroy a cu mutex_t object and the data.
void cu_spawn(thread_t *thread)
Spawn a new thread.