cnd_wait(3) | Library Functions Manual | cnd_wait(3) |
NAME
cnd_wait
— wait
for a condition
SYNOPSIS
library “threads”
#include <threads.h>
int
cnd_wait
(cnd_t
*cnd, mtx_t
*mtx);
DESCRIPTION
The function
cnd_wait
()
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
cnd_wait
()
may be woken up by signals.
RETURN VALUES
Upon success cnd_wait
() returns
thrd_success, otherwise
thrd_error will be returned.
SEE ALSO
cnd_init(3) cnd_destroy(3) cnd_broadcast(3) cnd_timedwait(3) cnd_signal(3) mtx_init(3)
HISTORY
The cnd_wait
() function first appeared in
the C11 standard ISO/IEC 9899:2011.
AUTHORS
Jan Adelsbach <jan@jadelsbach.de>
May 9, 2020 | Debian |