1SCHEDULE_TIMEOUT(9) Driver Basics SCHEDULE_TIMEOUT(9)
2
3
4
6 schedule_timeout - sleep until timeout
7
9 signed long __sched schedule_timeout(signed long timeout);
10
12 timeout
13 timeout value in jiffies
14
16 Make the current task sleep until timeout jiffies have elapsed. The
17 routine will return immediately unless the current task state has been
18 set (see set_current_state).
19
20 You can set the task state as follows -
21
22 TASK_UNINTERRUPTIBLE - at least timeout jiffies are guaranteed to pass
23 before the routine returns. The routine will return 0
24
25 TASK_INTERRUPTIBLE - the routine may return early if a signal is
26 delivered to the current task. In this case the remaining time in
27 jiffies will be returned, or 0 if the timer expired in time
28
29 The current task state is guaranteed to be TASK_RUNNING when this
30 routine returns.
31
32 Specifying a timeout value of MAX_SCHEDULE_TIMEOUT will schedule the
33 CPU away without a bound on the timeout. In this case the return value
34 will be MAX_SCHEDULE_TIMEOUT.
35
36 In all cases the return value is guaranteed to be non-negative.
37
39Kernel Hackers Manual 2.6. June 2019 SCHEDULE_TIMEOUT(9)