cnd_timedwait
Header: <threads.h>
Atomically unlocks the mutex pointed to by mutex and blocks on the condition variable pointed to by cond until the thread is signalled by cnd_signal or cnd_broadcast, or until the TIME_UTC based time point pointed to by time_point has been reached, or until a spurious wake-up occurs. The mutex is locked again before the function returns.
# Declarations
int cnd_timedwait( cnd_t* restrict cond, mtx_t* restrict mutex,
const struct timespec* restrict time_point );
(since C11)
# Parameters
cond: pointer to the condition variable to block onmutex: pointer to the mutex to unlock for the duration of the blocktime_point: pointer to an object specifying timeout time to wait until
# Return value
thrd_success if successful, thrd_timedout if the timeout time has been reached before the mutex is locked, or thrd_error if an error occurred.