Data Structures | |
struct | rdwr_var |
Reader/Writer lock struct. More... | |
Defines | |
#define | thread_rdwrattr_default NULL; |
default value | |
#define | T_RDWR thread_rdwr_t |
wrapper for read/write thread struct | |
#define | T_RDWRATTR thread_rdwrattr_t |
wrapper for read/write attr struct | |
#define | T_MUTEX int |
dummy wrapper for mutex | |
#define | T_MUTEXATTR int |
dummy wrapper for mutex attributes | |
#define | T_COND int |
dummy wrapper for conditional | |
#define | T_CONDATTR int |
dummy wrapper for conditional attributes | |
#define | T_THREAD int |
dummy wrapper for thread | |
#define | T_THREADATTR int |
dummy wrapper for thread attributes | |
#define | T_MUTEX_INIT(mutex, attr) thread_mutex_init(mutex, attr) |
wrapper for initialize mutex lock | |
#define | T_MUTEX_LOCK(mutex) thread_mutex_lock(mutex) |
wrapper for setting mutex lock | |
#define | T_MUTEX_TRYLOCK(mutex) thread_mutex_trylock(mutex) |
wrapper for setting mutex try lock | |
#define | T_MUTEX_UNLOCK(mutex) thread_mutex_unlock(mutex) |
wrapper for releasing mutex lock | |
#define | T_MUTEX_DESTROY(mutex) thread_mutex_destroy(mutex) |
wrapper for destroying mutex | |
#define | T_COND_INIT(cond, attr) thread_cond_init(cond, attr); |
wrapper for initialize conditional | |
#define | T_COND_SIGNAL(cond) thread_cond_signal(cond) |
wrapper for sending conditional signal | |
#define | T_COND_BROADCAST(cond) thread_cond_broadcast(cond) |
wrapper for sending conditional broadcast | |
#define | T_COND_WAIT(cond, mutex) thread_cond_wait(cond, mutex) |
wrapper for waiting for conditional wait on mutex | |
#define | T_COND_TIMEDWAIT(c, m, t) thread_cond_timedwait(c, m, t) |
wrapper for waiting for conditional wait on mutex with timeout | |
#define | T_COND_DESTROY(cond) thread_cond_destroy(cond) |
wrapper for destroying conditional | |
#define | T_RDWR_INIT(rdwrp, attrp) thread_rdwr_init_np(rdwrp, attrp) |
wrapper for initialize read/write lock | |
#define | T_RDWR_RLOCK(rdwrp) thread_rdwr_rlock_np(rdwrp) |
wrapper for setting read lock | |
#define | T_RDWR_RUNLOCK(rdwrp) thread_rdwr_runlock_np(rdwrp) |
wrapper for releasing read lock | |
#define | T_RDWR_WLOCK(rdwrp) thread_rdwr_wlock_np(rdwrp) |
wrapper for setting write lock | |
#define | T_RDWR_WUNLOCK(rdwrp) thread_rdwr_wunlock_np(rdwrp) |
wrapper for releasing write lock | |
#define | T_CREATE(t, attr, func, arg) thread_create(t, attr, func, arg) |
wrapper for creating new thread | |
#define | T_JOIN(t, ret) thread_join(t, ret) |
wrapper for joining a thread | |
#define | T_EXIT(ret) thread_exit(ret) |
wrapper for exiting a thread | |
#define | T_CANCEL(t) thread_cancel(t) |
wrapper for cancelling a thread | |
Typedefs | |
typedef void * | thread_rdwrattr_t |
read/write lock pointer | |
typedef rdwr_var | T_RDWR |
Reader/Writer lock struct. | |
Functions | |
int | thread_create (T_THREAD *thread, T_THREADATTR *attr, void *(*routine)(void *), void *arg) |
Create a thread. | |
int | thread_join (T_THREAD thread, void **ret) |
Join a thread. | |
int | thread_exit (void *ret) |
Exit a thread. | |
int | thread_cancel (T_THREAD thread) |
Cancel a thread. | |
int | thread_cond_init (T_COND *cond, T_CONDATTR *cond_attr) |
Initializing a conditional variable. | |
int | thread_cond_signal (T_COND *cond) |
Sending a conditional signal. | |
int | thread_cond_broadcast (T_COND *cond) |
Sending a conditional broadcast. | |
int | thread_cond_wait (T_COND *cond, T_MUTEX *mutex) |
Waiting for conditional wait on mutex. | |
int | thread_cond_timedwait (T_COND *cond, T_MUTEX *mutex, unsigned int timeout) |
Waiting for conditional wait on mutex with timeout. | |
int | thread_cond_destroy (T_COND *cond) |
Destroying conditional. | |
int | thread_mutex_init (T_MUTEX *mutex, T_MUTEXATTR *mutexattr) |
Initializing a mutex. | |
int | thread_mutex_lock (T_MUTEX *mutex) |
Lock a mutex. | |
int | thread_mutex_trylock (T_MUTEX *mutex) |
Try to lock a mutex. | |
int | thread_mutex_unlock (T_MUTEX *mutex) |
Unlock a mutex. | |
int | thread_mutex_destroy (T_MUTEX *mutex) |
Lock a mutex. | |
int | thread_rdwr_init_np (T_RDWR *rdwrp, T_RDWRATTR *attrp) |
Initializing a Reader/Writer Lock. | |
int | thread_rdwr_rlock_np (T_RDWR *rdwrp) |
Read Locking a Reader/Writer Lock. | |
int | thread_rdwr_runlock_np (T_RDWR *rdwrp) |
Read Unlocking a Reader/Writer Lock. | |
int | thread_rdwr_wlock_np (T_RDWR *rdwrp) |
Write Locking a Reader/Writer Lock. | |
int | thread_rdwr_wunlock_np (T_RDWR *rdwrp) |
Write Unlocking a Reader/Writer Lock. |
|
Cancel a thread.
Definition at line 57 of file threading.c. |
|
Sending a conditional broadcast.
Definition at line 111 of file threading.c. |
|
Destroying conditional.
Definition at line 177 of file threading.c. |
|
Initializing a conditional variable.
Definition at line 78 of file threading.c. |
|
Sending a conditional signal.
Definition at line 95 of file threading.c. |
|
Waiting for conditional wait on mutex with timeout.
Definition at line 143 of file threading.c. |
|
Waiting for conditional wait on mutex.
Definition at line 127 of file threading.c. |
|
Create a thread.
Definition at line 13 of file threading.c. |
|
Exit a thread.
Definition at line 43 of file threading.c. |
|
Join a thread.
Definition at line 30 of file threading.c. |
|
Lock a mutex.
Definition at line 266 of file threading.c. |
|
Initializing a mutex.
Definition at line 201 of file threading.c. |
|
Lock a mutex.
Definition at line 218 of file threading.c. |
|
Try to lock a mutex.
Definition at line 234 of file threading.c. |
|
Unlock a mutex.
Definition at line 250 of file threading.c. |
|
Initializing a Reader/Writer Lock.
Definition at line 290 of file threading.c. References rdwr_var::lock_free, rdwr_var::mutex, rdwr_var::readers_reading, T_COND_INIT, T_MUTEX_INIT, T_RDWR, and rdwr_var::writer_writing. |
|
Read Locking a Reader/Writer Lock.
Definition at line 307 of file threading.c. References rdwr_var::lock_free, rdwr_var::mutex, rdwr_var::readers_reading, T_COND_WAIT, T_MUTEX_LOCK, T_MUTEX_UNLOCK, T_RDWR, and rdwr_var::writer_writing. |
|
Read Unlocking a Reader/Writer Lock.
Definition at line 326 of file threading.c. References rdwr_var::lock_free, rdwr_var::mutex, rdwr_var::readers_reading, T_COND_SIGNAL, T_MUTEX_LOCK, T_MUTEX_UNLOCK, and T_RDWR. |
|
Write Locking a Reader/Writer Lock.
Definition at line 350 of file threading.c. References rdwr_var::lock_free, rdwr_var::mutex, rdwr_var::readers_reading, T_COND_WAIT, T_MUTEX_LOCK, T_MUTEX_UNLOCK, T_RDWR, and rdwr_var::writer_writing. |
|
Write Unlocking a Reader/Writer Lock.
Definition at line 369 of file threading.c. References rdwr_var::lock_free, rdwr_var::mutex, T_COND_BROADCAST, T_MUTEX_LOCK, T_MUTEX_UNLOCK, T_RDWR, and rdwr_var::writer_writing. |