The
pthread_cond_timedwait()
function atomically blocks the current thread waiting on the condition
variable specified by
cond,
and releases the mutex specified by
mutex.
The waiting thread unblocks only after another thread calls
pthread_cond_signal(3),
or
pthread_cond_broadcast(3)
with the same condition variable, or if the system time reaches the
time specified in
abstime,
and the current thread reacquires the lock on
mutex.
The clock used to measure
abstime
can be specified during creation of the condition variable using
pthread_condattr_setclock(3).