next up previous contents index
Next: 25.6.6 pthread_attr_setscheduler: Set the Up: 25.6 CPU Inheritance Framework Previous: 25.6.4 pthread_sched_setstate: Set the

25.6.5 pthread_cond_donate_wait: Timed condition wait with CPU donation

 

SYNOPSIS

#include <oskit/threads/pthread.h>
#include <oskit/threads/cpuinherit.h>

int pthread_cond_donate_wait(pthread_cond_t *c, pthread_mutex_t *m, oskit_timespec_t *abstime, pthread_t donee_tid);

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.

In addition to the normal operation for timed conditional wait, the caller specifies a thread to which the current thread's CPU time should be donated. This allows a thread to wait on a condition, but specify that any CPU time that it would have received is donated to thread donee_tid.

PARAMETERS

cond
A pointer to the condition variable object.
mutex
A pointer to the mutex object.
abstime
A pointer to an oskit_timespec structure.
donee_tid
The pthread_t of the thread to which the current thread's CPU time should be donated.

RETURNS

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



Utah Flux Research Group