next up previous contents index
Next: 6.16.3 osenv_wakeup: wake up Up: 6.16 Sleep/Wakeup Previous: 6.16.1 osenv_sleep_init: prepare to

6.16.2 osenv_sleep: put the current process to sleep

 

SYNOPSIS

#include <oskit/dev/dev.h>

int osenv_sleep(osenv_sleeprec_t *sleeprec);

DIRECTION

Component tex2html_wrap_inline32841 OS, Blocking

DESCRIPTION

The driver calls this function at process level to put the current activity (process) to sleep until some event occurs, typically triggered by a hardware interrupt or timer handler. The driver must supply a pointer to a process-private ``sleep record'' variable (sleeprec), which is typically just allocated on the stack by the driver. The sleeprec must already have been initialized using osenv_sleep_init. If the event of interest occurs after the osenv_sleep_init but before the osenv_sleep, then osenv_sleep will return immediately without blocking.

PARAMETERS

sleeprec
A pointer to the process-private sleep record, already allocated by the driver and initialized using osenv_sleep_init.

RETURNS

Returns the wakeup status value provided to osenv_wakeup.



University of Utah Flux Research Group