FreeBSD Manual Pages

TIMEOUT(9) FreeBSD Kernel Developer's Manual TIMEOUT(9)
NAMEtimeout, untimeout -- schedule timer events
SYNOPSIS#include <sys/systm.h>
#include <sys/kernel.h>
typedefvoid (timeout_t) (void*);typedeftimeout_t*timeout_func_t;voidtimeout(timeout_func_tfunc, void*arg, intticks);
voiduntimeout(timeout_func_tfunc, void*arg);
DESCRIPTION
The timeout facility allows the execution of a function after a specified
amount of time. The function func is being called with the opaque argu-
ment arg after ticks timer ticks have been elapsed. It's often conve-
nient to use the external variable hz to compute the amount of ticks to
wait.
If the timeout event should be removed before the timer expires,
untimeout must be called with the exact func and arg arguments as the
corresponding call to timeout().
Unlike the functions of sleep(9), timeout() and untimeout() can be called
from within an interrupt context.
SEE ALSOsleep(9)HISTORY
The timeout facility is very old.
BUGS
Since the timer queue is sorted and uses time differences rather than
absolute times, inserting and removing timer events can be costly if it
is done too frequently.
AUTHORS
This man page has been written by Joerg Wunsch.
FreeBSD 11.1 April 13, 1996 FreeBSD 11.1