cnd_init, cnd_wait, cnd_timedwait, cnd_signal, cnd_broadcast, cnd_destroy - C11 condition variable functions
#include <threads.h>
int cnd_init(cnd_t *cond);
int cnd_wait(cnd_t *cond, mtx_t *mtx);
int cnd_timedwait(cnd_t *restrict cond, mtx_t *restrict mtx, const struct timespec *restrict ts);
int cnd_signal(cnd_t *cond);
int cnd_broadcast(cnd_t *cond);
void cnd_destroy(cnd_t *cond);
The cnd_init(), cnd_wait(), cnd_timedwait(), cnd_signal(), cnd_broadcast(), and cnd_destroy() functions are part of the threads interfaces as specified in the C11 standard. They are simple wrappers over the more general pthreads functions. See INCITS/ISO/IEC 9899:2011.
|
Upon successful completion, each of the cnd_init(), cnd_wait(), cnd_timedwait(), cnd_signal(), and cnd_broadcast() functions return thrd_success. If allocation of memory fails for the newly created condition, cnd_init() returns thrd_nomem. If the requested resource is not acquired in the time specified by ts to cnd_timedwait(), cnd_timedwait() returns thrd_timedout. If the request could not otherwise be honored by any of these functions, thrd_error is returned.
No value is returned by the cnd_destroy() function.
See attributes(7) for descriptions of the following attributes:
|
pthread_cond_broadcast(3C), pthread_cond_destroy(3C), pthread_cond_init(3C), pthread_cond_signal(3C), pthread_cond_timedwait(3C), pthread_cond_wait(3C), threads.h(3HEAD), attributes(7), condition(7), mutex(7)