|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
#include <pthread.h>
Include dependency graph for vl_condition_pthread.c:Functions | |
| vl_condition | vlConditionNew (void) |
| Creates and initializes a new condition variable. | |
| void | vlConditionDelete (vl_condition cond) |
| De-initializes and deletes a condition variable. | |
| void | vlConditionWait (vl_condition cond, vl_mutex mutex) |
| Waits on a condition variable. | |
| vl_bool_t | vlConditionWaitTimeout (vl_condition cond, vl_mutex mutex, vl_ularge_t millis) |
| Waits on a condition variable with a timeout. | |
| void | vlConditionSignal (vl_condition cond) |
| Signals a condition variable, waking up at least one thread waiting on it. | |
| void | vlConditionBroadcast (vl_condition cond) |
| Broadcasts a condition variable to wake up all waiting threads. | |
| void vlConditionBroadcast | ( | vl_condition | cond | ) |
Broadcasts a condition variable to wake up all waiting threads.
cond must not be NULL.NULL.| cond | The condition variable to broadcast. It must be a valid vl_condition that has been properly initialized. |
| void vlConditionDelete | ( | vl_condition | cond | ) |
De-initializes and deletes a condition variable.
NULL results in undefined behavior (will attempt to destroy a null pointer).NULL. Deleting a condition variable that still has threads waiting on it. Double deletion.| cond | The condition variable handle to delete. |
Here is the caller graph for this function:| vl_condition vlConditionNew | ( | void | ) |
Creates and initializes a new condition variable.
vl_condition handle and is responsible for calling vlConditionDelete.vlConditionDelete.NULL if allocation fails, but the implementation may crash due to unhandled NULL in pthread_cond_init.
Here is the caller graph for this function:| void vlConditionSignal | ( | vl_condition | cond | ) |
Signals a condition variable, waking up at least one thread waiting on it.
cond must not be NULL.NULL.| cond | The condition variable to signal. |
| void vlConditionWait | ( | vl_condition | cond, |
| vl_mutex | mutex | ||
| ) |
Waits on a condition variable.
This function causes the calling thread to block until the specified condition variable has been signaled. It atomically releases the provided mutex and suspends the thread execution until the condition is signaled. After being signaled, the mutex is reacquired by the calling thread before the function returns.
mutex.cond and mutex must not be NULL.mutex. Spurious wakeups (caller should use a loop).| cond | The condition variable on which to wait. |
| mutex | The mutex associated with the condition variable. It must be locked by the calling thread before calling this function. |
Here is the caller graph for this function:| vl_bool_t vlConditionWaitTimeout | ( | vl_condition | cond, |
| vl_mutex | mutex, | ||
| vl_ularge_t | millis | ||
| ) |
Waits on a condition variable with a timeout.
cond and mutex must not be NULL.VL_FALSE if the timeout expires.mutex.VL_TRUE if the condition was signaled, VL_FALSE on timeout or error.| cond | The condition variable to wait on. |
| mutex | The mutex associated with the condition. |
| millis | The timeout period in milliseconds. |
Here is the caller graph for this function: