The
pthread_cond_timedwait ();
function atomically blocks the current thread waiting on the condition
variable specified by
Fa cond ,
and releases the mutex specified by
Fa mutex .
The waiting thread unblocks only after another thread calls
pthread_cond_signal3,
or
pthread_cond_broadcast3
with the same condition variable, or if the system time reaches the
time specified in
Fa abstime ,
and the current thread reacquires the lock on
Fa mutex .
RETURN VALUES
If successful, the
pthread_cond_timedwait ();
function will return zero.
Otherwise an error number will be returned to
indicate the error.
ERRORS
The
pthread_cond_timedwait ();
function will fail if:
Bq Er EINVAL
The value specified by
Fa cond ,
Fa mutex
or
Fa abstime
is invalid.
Bq Er ETIMEDOUT
The system time has reached or exceeded the time specified in
Fa abstime .
Bq Er EPERM
The specified
Fa mutex
was not locked by the calling thread.