1WAIT_EVENT_TIMEOUT(9) Driver Basics WAIT_EVENT_TIMEOUT(9)
2
3
4
6 wait_event_timeout - sleep until a condition gets true or a timeout
7 elapses
8
10 wait_event_timeout(wq, condition, timeout);
11
13 wq
14 the waitqueue to wait on
15
16 condition
17 a C expression for the event to wait for
18
19 timeout
20 timeout, in jiffies
21
23 The process is put to sleep (TASK_UNINTERRUPTIBLE) until the condition
24 evaluates to true. The condition is checked each time the waitqueue wq
25 is woken up.
26
27 wake_up has to be called after changing any variable that could change
28 the result of the wait condition.
29
30 The function returns 0 if the timeout elapsed, or the remaining jiffies
31 (at least 1) if the condition evaluated to true before the timeout
32 elapsed.
33
35Kernel Hackers Manual 3.10 June 2019 WAIT_EVENT_TIMEOUT(9)