#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);
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.
- 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 zero on success. Returns ETIMEDOUT if the timeout expires.