Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

schedule_timeout(9) [suse man page]

SCHEDULE_TIMEOUT(9)						   Driver Basics					       SCHEDULE_TIMEOUT(9)

NAME
schedule_timeout - sleep until timeout SYNOPSIS
signed long __sched schedule_timeout(signed long timeout); ARGUMENTS
timeout timeout value in jiffies DESCRIPTION
Make the current task sleep until timeout jiffies have elapsed. The routine will return immediately unless the current task state has been set (see set_current_state). You can set the task state as follows - TASK_UNINTERRUPTIBLE - at least timeout jiffies are guaranteed to pass before the routine returns. The routine will return 0 TASK_INTERRUPTIBLE - the routine may return early if a signal is delivered to the current task. In this case the remaining time in jiffies will be returned, or 0 if the timer expired in time The current task state is guaranteed to be TASK_RUNNING when this routine returns. Specifying a timeout value of MAX_SCHEDULE_TIMEOUT will schedule the CPU away without a bound on the timeout. In this case the return value will be MAX_SCHEDULE_TIMEOUT. In all cases the return value is guaranteed to be non-negative. COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 SCHEDULE_TIMEOUT(9)

Check Out this Related Man Page

timeout(9r)															       timeout(9r)

NAME
timeout - General: Initializes a callout queue element SYNOPSIS
void timeout( int (*function) (), caddr_t argument, register int time ); ARGUMENTS
Specifies a pointer to the routine to be called. Specifies a single argument to be passed to the called routine. Specifies the amount of time to delay before calling the specified routine. You express time as time (in seconds) * hz. DESCRIPTION
The timeout routine initializes a callout queue element to make it easy to execute the specified routine at the time specified in the time argument. You often use callout routines for infrequent polling or error handling. The routine you specify will be called on the interrupt stack (not in processor context) as dispatched from the softclock routine. The global variable hz contains the number of clock ticks per second. This variable is a second's worth of clock ticks. Thus, if you wanted a 4-minute timeout, you would pass 4 * 60 * hz as the third argument to the timeout routine as follows: /* A 4-minute timeout */ . . . timeout(lptout, (caddr_t)dev, 4 * 60 * hz); NOTES
The granularity of the time delay is dependent on the hardware. For example, the granularity of some Alpha CPUs is 1024 clock ticks per second. Other Alpha CPUs have a granularity of 1200 clock ticks per second. Still other Alpha CPUs exhibit a granularity of 128 clock ticks per second. Because the granularity of the time delay is dependent on the hardware, the operating system provides the hz and lbolt global variables. Use the hz global variable to determine the number of clock ticks per second for a specific Alpha CPU. Use the lbolt global variable as a periodic wakeup mechanism. RETURN VALUES
None SEE ALSO
Routines: untimeout(9r) timeout(9r)
Man Page