next up previous contents index
Next: 18.3.25 pthread_create: Create a Up: 18.3 POSIX Threads Reference Previous: 18.3.23 pthread_cond_wait: Wait on

18.3.24 pthread_cond_timedwait: Wait on a condition variable with timeout

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, oskit_timespec_t *abstime);

DESCRIPTION

The current thread is made to wait until the condition variable is signaled or broadcast, or until the timeout expires. The mutex is released prior to waiting, and reacquired before returning. The timeout is given as an absolute time in the future that bounds the wait.

PARAMETERS

cond
A pointer to the condition variable object.
mutex
A pointer to the mutex object.
abstime
A pointer to an oskit_timespec structure.

RETURNS

Returns zero on success. Returns ETIMEDOUT if the timeout expires.

RELATED INFORMATION

pthread_cond_signal, pthread_cond_broadcast, pthread_cond_wait



University of Utah Flux Research Group