1WAIT_EVENT_INTERRUPT(9) Driver Basics WAIT_EVENT_INTERRUPT(9)
2
3
4
6 wait_event_interruptible_exclusive_locked - sleep exclusively until a
7 condition gets true
8
10 wait_event_interruptible_exclusive_locked(wq, condition);
11
13 wq
14 the waitqueue to wait on
15
16 condition
17 a C expression for the event to wait for
18
20 The process is put to sleep (TASK_INTERRUPTIBLE) until the condition
21 evaluates to true or a signal is received. The condition is checked
22 each time the waitqueue wq is woken up.
23
24 It must be called with wq.lock being held. This spinlock is unlocked
25 while sleeping but condition testing is done while lock is held and
26 when this macro exits the lock is held.
27
28 The lock is locked/unlocked using spin_lock/spin_unlock functions which
29 must match the way they are locked/unlocked outside of this macro.
30
31 The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag set
32 thus when other process waits process on the list if this process is
33 awaken further processes are not considered.
34
35 wake_up_locked has to be called after changing any variable that could
36 change the result of the wait condition.
37
38 The function will return -ERESTARTSYS if it was interrupted by a signal
39 and 0 if condition evaluated to true.
40
42Kernel Hackers Manual 3.10 June 2019 WAIT_EVENT_INTERRUPT(9)