#include <pthread.h>
int
pthread_cond_broadcast
(pthread_cond_t *
cond );
The pthread_cond_broadcast function unblocks all threads that are waiting on the given condition variable.
The pthread_cond_broadcast function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.
None.
#include <pthread.h>
int
pthread_cond_destroy
(pthread_cond_t * cond );
The pthread_cond_destroy function destroys the given condition variable. If the variable has one or more waiting threads then errno is set to EBUSY.
The pthread_cond_destroy function returns zero if the call is successful, otherwise it sets errno and returns -1.
None.
#include <pthread.h>
int
pthread_cond_init
(pthread_cond_t * cond , pthread_condattr_t * attr );
The pthread_cond_init function initializes the given condition variable.
The pthread_cond_init function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.
The value of attr must be null.
#include <pthread.h>
int
pthread_cond_signal
(pthread_cond_t * cond );
The pthread_cond_signal function unblocks at least one thread waiting on a condition variable. The scheduling priority determines which thread is runs next.
The pthread_cond_signal function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.
None.
#include <pthread.h>
int
pthread_cond_timedwait
(pthread_cond_t *
cond , pthread_mutex_t *
mutex , struct timespec *
timeout );
The pthread_cond_timedwait function unlocks the given mutex and places the calling thread into blocked state. When the specified condition variable is signaled or broadcast, or the system time is greater than i or equal to timeout, this function re-locks the mutex and returns to the caller.
The pthread_cond_timedwait function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.
None.
#include <pthread.h>
int
pthread_cond_wait
(pthread_cond_t * cond , pthread_mutex_t * mutex );
The pthread_cond_wait function unlocks the given mutex and places the calling thread into a blocked state. When the specified condition variable is signaled or broadcast, this function re-locks the mutex and returns to the caller.
The pthread_cond_wait function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.
None.