Lines Matching refs:wq_head

62 extern void __init_waitqueue_head(struct wait_queue_head *wq_head, const char *name, struct lock_class_key *);
64 #define init_waitqueue_head(wq_head) \
68 __init_waitqueue_head((wq_head), #wq_head, &__key); \
97 * @wq_head: the waitqueue to test for waiters
110 * @cond = true; prepare_to_wait(&wq_head, &wait, state);
112 * if (waitqueue_active(wq_head)) if (@cond)
113 * wake_up(wq_head); break;
116 * finish_wait(&wq_head, &wait);
125 static inline int waitqueue_active(struct wait_queue_head *wq_head)
127 return !list_empty(&wq_head->head);
132 * @wq_head: wait queue head
134 * Returns true of wq_head has only one sleeper on the list.
138 static inline bool wq_has_single_sleeper(struct wait_queue_head *wq_head)
140 return list_is_singular(&wq_head->head);
145 * @wq_head: wait queue head
147 * Returns true if wq_head has waiting processes
151 static inline bool wq_has_sleeper(struct wait_queue_head *wq_head)
161 return waitqueue_active(wq_head);
164 extern void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
165 extern void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
166 extern void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
167 extern void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
169 static inline void __add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
171 struct list_head *head = &wq_head->head;
174 list_for_each_entry(wq, &wq_head->head, entry) {
186 __add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
189 __add_wait_queue(wq_head, wq_entry);
192 static inline void __add_wait_queue_entry_tail(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
194 list_add_tail(&wq_entry->entry, &wq_head->head);
198 __add_wait_queue_entry_tail_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
201 __add_wait_queue_entry_tail(wq_head, wq_entry);
205 __remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
210 int __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key);
211 void __wake_up_on_current_cpu(struct wait_queue_head *wq_head, unsigned int mode, void *key);
212 void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
213 void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
214 void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
215 void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr);
216 void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode);
217 void __wake_up_pollfree(struct wait_queue_head *wq_head);
250 * @wq_head: the wait queue head
260 static inline void wake_up_pollfree(struct wait_queue_head *wq_head)
269 if (waitqueue_active(wq_head))
270 __wake_up_pollfree(wq_head);
299 #define ___wait_event(wq_head, condition, state, exclusive, ret, cmd) \
307 long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\
319 finish_wait(&wq_head, &__wq_entry); \
323 #define __wait_event(wq_head, condition) \
324 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
329 * @wq_head: the waitqueue to wait on
334 * the waitqueue @wq_head is woken up.
339 #define wait_event(wq_head, condition) \
344 __wait_event(wq_head, condition); \
347 #define __io_wait_event(wq_head, condition) \
348 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
354 #define io_wait_event(wq_head, condition) \
359 __io_wait_event(wq_head, condition); \
362 #define __wait_event_freezable(wq_head, condition) \
363 ___wait_event(wq_head, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), \
368 * @wq_head: the waitqueue to wait on
373 * @condition is checked each time the waitqueue @wq_head is woken up.
378 #define wait_event_freezable(wq_head, condition) \
383 __ret = __wait_event_freezable(wq_head, condition); \
387 #define __wait_event_timeout(wq_head, condition, timeout) \
388 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
394 * @wq_head: the waitqueue to wait on
400 * the waitqueue @wq_head is woken up.
411 #define wait_event_timeout(wq_head, condition, timeout) \
416 __ret = __wait_event_timeout(wq_head, condition, timeout); \
420 #define __wait_event_freezable_timeout(wq_head, condition, timeout) \
421 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
429 #define wait_event_freezable_timeout(wq_head, condition, timeout) \
434 __ret = __wait_event_freezable_timeout(wq_head, condition, timeout); \
438 #define __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \
439 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 1, 0, \
444 #define wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \
448 __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2); \
451 #define __wait_event_cmd(wq_head, condition, cmd1, cmd2) \
452 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
457 * @wq_head: the waitqueue to wait on
464 * the waitqueue @wq_head is woken up.
469 #define wait_event_cmd(wq_head, condition, cmd1, cmd2) \
473 __wait_event_cmd(wq_head, condition, cmd1, cmd2); \
476 #define __wait_event_interruptible(wq_head, condition) \
477 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
482 * @wq_head: the waitqueue to wait on
487 * The @condition is checked each time the waitqueue @wq_head is woken up.
495 #define wait_event_interruptible(wq_head, condition) \
500 __ret = __wait_event_interruptible(wq_head, condition); \
504 #define __wait_event_interruptible_timeout(wq_head, condition, timeout) \
505 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
511 * @wq_head: the waitqueue to wait on
517 * The @condition is checked each time the waitqueue @wq_head is woken up.
529 #define wait_event_interruptible_timeout(wq_head, condition, timeout) \
534 __ret = __wait_event_interruptible_timeout(wq_head, \
539 #define __wait_event_hrtimeout(wq_head, condition, timeout, state) \
552 __ret = ___wait_event(wq_head, condition, state, 0, 0, \
566 * @wq_head: the waitqueue to wait on
572 * The @condition is checked each time the waitqueue @wq_head is woken up.
580 #define wait_event_hrtimeout(wq_head, condition, timeout) \
585 __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \
658 * @wq_head: the waitqueue to wait on
663 * The @condition is checked each time the waitqueue @wq_head is woken up.
669 #define wait_event_idle(wq_head, condition) \
673 ___wait_event(wq_head, condition, TASK_IDLE, 0, 0, schedule()); \
678 * @wq_head: the waitqueue to wait on
683 * The @condition is checked each time the waitqueue @wq_head is woken up.
693 #define wait_event_idle_exclusive(wq_head, condition) \
697 ___wait_event(wq_head, condition, TASK_IDLE, 1, 0, schedule()); \
700 #define __wait_event_idle_timeout(wq_head, condition, timeout) \
701 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
707 * @wq_head: the waitqueue to wait on
713 * the waitqueue @wq_head is woken up.
724 #define wait_event_idle_timeout(wq_head, condition, timeout) \
729 __ret = __wait_event_idle_timeout(wq_head, condition, timeout); \
733 #define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
734 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
740 * @wq_head: the waitqueue to wait on
746 * the waitqueue @wq_head is woken up.
761 #define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
766 __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
912 * @wq_head: the waitqueue to wait on
917 * The @condition is checked each time the waitqueue @wq_head is woken up.
925 #define wait_event_killable(wq_head, condition) \
930 __ret = __wait_event_killable(wq_head, condition); \
939 * @wq_head: the waitqueue to wait on
945 * each time the waitqueue @wq_head is woken up.
953 #define wait_event_state(wq_head, condition, state) \
958 __ret = __wait_event_state(wq_head, condition, state); \
962 #define __wait_event_killable_timeout(wq_head, condition, timeout) \
963 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
969 * @wq_head: the waitqueue to wait on
975 * The @condition is checked each time the waitqueue @wq_head is woken up.
989 #define wait_event_killable_timeout(wq_head, condition, timeout) \
994 __ret = __wait_event_killable_timeout(wq_head, \
1000 #define __wait_event_lock_irq(wq_head, condition, lock, cmd) \
1001 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
1012 * @wq_head: the waitqueue to wait on
1021 * the waitqueue @wq_head is woken up.
1030 #define wait_event_lock_irq_cmd(wq_head, condition, lock, cmd) \
1034 __wait_event_lock_irq(wq_head, condition, lock, cmd); \
1042 * @wq_head: the waitqueue to wait on
1049 * the waitqueue @wq_head is woken up.
1057 #define wait_event_lock_irq(wq_head, condition, lock) \
1061 __wait_event_lock_irq(wq_head, condition, lock, ); \
1065 #define __wait_event_interruptible_lock_irq(wq_head, condition, lock, cmd) \
1066 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
1076 * @wq_head: the waitqueue to wait on
1085 * checked each time the waitqueue @wq_head is woken up.
1097 #define wait_event_interruptible_lock_irq_cmd(wq_head, condition, lock, cmd) \
1101 __ret = __wait_event_interruptible_lock_irq(wq_head, \
1110 * @wq_head: the waitqueue to wait on
1117 * checked each time the waitqueue @wq_head is woken up.
1128 #define wait_event_interruptible_lock_irq(wq_head, condition, lock) \
1132 __ret = __wait_event_interruptible_lock_irq(wq_head, \
1137 #define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \
1138 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1148 * @wq_head: the waitqueue to wait on
1156 * checked each time the waitqueue @wq_head is woken up.
1168 #define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \
1174 wq_head, condition, lock, timeout, \
1179 #define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \
1184 wq_head, condition, lock, timeout, \
1192 void prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1193 bool prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1194 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1195 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);