Adelsbach Enhanced Threading Library

Manual Pages (DD-00013-001)

Enhanced Threading Library > cnd_wait (3)
HTML TXT PDF PS
cnd_wait(3) Library Functions Manual cnd_wait(3)

cnd_waitwait for a condition

library “threads”
#include <threads.h>

int
cnd_wait(cnd_t *cnd, mtx_t *mtx);

The function () will stall the calling thread until a condition is being send to cnd from an other thread using either of cnd_signal(3) or cnd_broadcast(3). The function will release the mutex mtx atomically and hold it once the thread resumes execution.

A thread waiting with () may be woken up by signals.

Upon success cnd_wait() returns thrd_success, otherwise thrd_error will be returned.

cnd_init(3) cnd_destroy(3) cnd_broadcast(3) cnd_timedwait(3) cnd_signal(3) mtx_init(3)

The cnd_wait() function first appeared in the C11 standard ISO/IEC 9899:2011.

Jan Adelsbach <jan@jadelsbach.de>

May 9, 2020 Debian