timeout(D3) timeout(D3)
NAME
timeout - execute a function after a specified length of time
SYNOPSIS
#include <sys/types.h>
#include <sys/ddi.h>
int timeout(void (*fn)(), caddr_t arg, long ticks);
Arguments
fn Function to execute when the time increment expires.
arg Argument to the function.
ticks Number of clock ticks to wait before the function is
called.
DESCRIPTION
timeout schedules the specified function to be called after
the time interval specified by ticks. arg will be passed as
the only argument to function fn. The timeout call returns
immediately without waiting for the specified function to
execute.
Return Values
If the function specified by fn is successfully scheduled,
timeout returns an identifier that can be passed to
untimeout(D3) to cancel the request. If the function could
not be scheduled (because the timeout table is full), the
following panic message results:
PANIC: Timeout table overflow
USAGE
The length of time before the function is called is not
guaranteed to be exactly equal to the requested time, but will
be at least ticks clock ticks in length. If ticks specifies
the value zero, this implies that the function should be run
as soon as possible.
The function specified by fn must neither sleep nor reference
process context. When it runs, all interrupts will be
blocked. The function should not call any routine that will
lower the processor priority level.
After the time interval has expired, fn only runs if the
processor is at base level. Otherwise, fn is deferred until
some time in the near future.
Copyright 1994 Novell, Inc. Page 1
timeout(D3) timeout(D3)
Drivers should be careful to cancel any pending timeout
functions that access data structures before these structures
are de-initialized or deallocated.
Level
Base or Interrupt.
Synchronization Constraints
Does not sleep.
Examples
See the bufcall(D3) function page for an example of timeout.
REFERENCES
bufcall(D3), delay(D3), drv_usectohz(D3), untimeout(D3)
NOTICES
Portability
All processors
Applicability
ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp
itimeout(D3) replaces timeout.
Copyright 1994 Novell, Inc. Page 2