next up previous contents index
Next: 27.4.2 oskit_pthread_wakeup: Wakeup a Up: 27.4 Oskit API Extensions Previous: 27.4 Oskit API Extensions

27.4.1 oskit_pthread_sleep: Sleep for an interval of time

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int oskit_pthread_sleep(oskit_s64_t milliseconds);

DESCRIPTION

The calling thread is put to sleep for the number of milliseconds specified. The thread will be woken up after the elapsed time, and will return ETIMEDOUT. If the timeout is zero, the thread is put to sleep forever. The thread may be woken up early, using the oskit_pthread_wakeup function, in which case the return value is zero.

PARAMETERS

milliseconds
The number of milliseconds the thread should sleep for.

RETURNS

Returns ETIMEDOUT if the timeout expires, or zero if the thread is woken up early.

RELATED INFORMATION

oskit_pthread_wakeup



Utah Flux Research Group