Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
TIMEOUT(9)	       FreeBSD Kernel Developer's Manual	    TIMEOUT(9)

NAME
     timeout, untimeout	-- schedule timer events

SYNOPSIS
     #include <sys/systm.h>
     #include <sys/kernel.h>

     typedef void (timeout_t) (void *);

     typedef timeout_t *timeout_func_t;

     void
     timeout(timeout_func_t func, void *arg, int ticks);

     void
     untimeout(timeout_func_t func, 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 ALSO
     sleep(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

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | HISTORY | BUGS | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=timeout&sektion=9&manpath=FreeBSD+2.2.1-RELEASE>

home | help