Attention: This service should not be used in AIX Version 4, because it is not multi-processor safe. The base kernel timer and watchdog services should be used instead. See talloc and w_init for more information.
Schedules a function to be called after a specified interval.
#include <sys/types.h> #include <sys/errno.h>
void timeout (func, arg, ticks) void (*func)(); caddr_t *arg; int ticks;
The timeout service is not part of the kernel. However, it is a compatibility service provided in the libsys.a library. To use the timeout service, a kernel extension must have been bound with the libsys.a library. The timeout service, like the associated kernel services untimeout and timeoutcf, can be bound and used only in the pinned part of a kernel extension or the bottom half of a device driver because these services use interrupt disable for serialization.
The timeout service schedules the function pointed to by the func parameter to be called with the arg parameter after the number of timer ticks specified by the ticks parameter. Use the timeoutcf routine to allocate enough callout elements for the maximum number of simultaneous active time outs that you expect.
Note: The timeoutcf routine must be called before calling the timeout service.
Calling the timeout service without allocating a sufficient number of callout table entries can result in a kernel panic because of a lack of pinned callout table elements. The value of a timer tick depends on the hardware's capability. You can use the restimer subroutine to determine the minimum granularity.
Multiple pending timeout requests with the same func and arg parameters are not allowed.
The function specified by the func parameter should be declared as follows:
void func (arg) void *arg;
The timeout routine can be called from either the process or interrupt environment.
The function specified by the func parameter is called in the interrupt environment. Therefore, it must follow the conventions for interrupt handlers.
The timeout service has no return values.
The timeout routine is part of Base Operating System (BOS) Runtime.
The untimeout kernel service.
The timeoutcf kernel subroutine.
The restimer subroutine.
Timer and Time-of-Day Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.