Lines Matching defs: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 int add_wait_queue_priority_exclusive(struct wait_queue_head *wq_head,
169 extern void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
171 static inline void __add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
173 struct list_head *head = &wq_head->head;
176 list_for_each_entry(wq, &wq_head->head, entry) {
188 __add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
191 __add_wait_queue(wq_head, wq_entry);
194 static inline void __add_wait_queue_entry_tail(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
196 list_add_tail(&wq_entry->entry, &wq_head->head);
200 __add_wait_queue_entry_tail_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
203 __add_wait_queue_entry_tail(wq_head, wq_entry);
207 __remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
212 int __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key);
213 void __wake_up_on_current_cpu(struct wait_queue_head *wq_head, unsigned int mode, void *key);
214 void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
215 void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
216 void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
217 void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr);
218 void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode);
219 void __wake_up_pollfree(struct wait_queue_head *wq_head);
253 * @wq_head: the wait queue head
263 static inline void wake_up_pollfree(struct wait_queue_head *wq_head)
272 if (waitqueue_active(wq_head))
273 __wake_up_pollfree(wq_head);
302 #define ___wait_event(wq_head, condition, state, exclusive, ret, cmd) \
310 long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\
325 finish_wait(&wq_head, &__wq_entry); \
329 #define __wait_event(wq_head, condition) \
330 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
335 * @wq_head: the waitqueue to wait on
340 * the waitqueue @wq_head is woken up.
345 #define wait_event(wq_head, condition) \
350 __wait_event(wq_head, condition); \
353 #define __io_wait_event(wq_head, condition) \
354 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
360 #define io_wait_event(wq_head, condition) \
365 __io_wait_event(wq_head, condition); \
368 #define __wait_event_freezable(wq_head, condition) \
369 ___wait_event(wq_head, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), \
374 * @wq_head: the waitqueue to wait on
379 * @condition is checked each time the waitqueue @wq_head is woken up.
384 #define wait_event_freezable(wq_head, condition) \
389 __ret = __wait_event_freezable(wq_head, condition); \
393 #define __wait_event_timeout(wq_head, condition, timeout) \
394 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
400 * @wq_head: the waitqueue to wait on
406 * the waitqueue @wq_head is woken up.
417 #define wait_event_timeout(wq_head, condition, timeout) \
422 __ret = __wait_event_timeout(wq_head, condition, timeout); \
426 #define __wait_event_freezable_timeout(wq_head, condition, timeout) \
427 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
435 #define wait_event_freezable_timeout(wq_head, condition, timeout) \
440 __ret = __wait_event_freezable_timeout(wq_head, condition, timeout); \
444 #define __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \
445 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 1, 0, \
450 #define wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \
454 __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2); \
457 #define __wait_event_cmd(wq_head, condition, cmd1, cmd2) \
458 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
463 * @wq_head: the waitqueue to wait on
470 * the waitqueue @wq_head is woken up.
475 #define wait_event_cmd(wq_head, condition, cmd1, cmd2) \
479 __wait_event_cmd(wq_head, condition, cmd1, cmd2); \
482 #define __wait_event_interruptible(wq_head, condition) \
483 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
488 * @wq_head: the waitqueue to wait on
493 * The @condition is checked each time the waitqueue @wq_head is woken up.
501 #define wait_event_interruptible(wq_head, condition) \
506 __ret = __wait_event_interruptible(wq_head, condition); \
510 #define __wait_event_interruptible_timeout(wq_head, condition, timeout) \
511 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
517 * @wq_head: the waitqueue to wait on
523 * The @condition is checked each time the waitqueue @wq_head is woken up.
535 #define wait_event_interruptible_timeout(wq_head, condition, timeout) \
540 __ret = __wait_event_interruptible_timeout(wq_head, \
545 #define __wait_event_hrtimeout(wq_head, condition, timeout, state) \
558 __ret = ___wait_event(wq_head, condition, state, 0, 0, \
572 * @wq_head: the waitqueue to wait on
578 * The @condition is checked each time the waitqueue @wq_head is woken up.
586 #define wait_event_hrtimeout(wq_head, condition, timeout) \
591 __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \
664 * @wq_head: the waitqueue to wait on
669 * The @condition is checked each time the waitqueue @wq_head is woken up.
675 #define wait_event_idle(wq_head, condition) \
679 ___wait_event(wq_head, condition, TASK_IDLE, 0, 0, schedule()); \
684 * @wq_head: the waitqueue to wait on
689 * The @condition is checked each time the waitqueue @wq_head is woken up.
699 #define wait_event_idle_exclusive(wq_head, condition) \
703 ___wait_event(wq_head, condition, TASK_IDLE, 1, 0, schedule()); \
706 #define __wait_event_idle_timeout(wq_head, condition, timeout) \
707 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
713 * @wq_head: the waitqueue to wait on
719 * the waitqueue @wq_head is woken up.
730 #define wait_event_idle_timeout(wq_head, condition, timeout) \
735 __ret = __wait_event_idle_timeout(wq_head, condition, timeout); \
739 #define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
740 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
746 * @wq_head: the waitqueue to wait on
752 * the waitqueue @wq_head is woken up.
767 #define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
772 __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
918 * @wq_head: the waitqueue to wait on
923 * The @condition is checked each time the waitqueue @wq_head is woken up.
931 #define wait_event_killable(wq_head, condition) \
936 __ret = __wait_event_killable(wq_head, condition); \
946 #define io_wait_event_killable(wq_head, condition) \
951 __ret = __io_wait_event_killable(wq_head, condition); \
960 * @wq_head: the waitqueue to wait on
966 * each time the waitqueue @wq_head is woken up.
974 #define wait_event_state(wq_head, condition, state) \
979 __ret = __wait_event_state(wq_head, condition, state); \
995 #define __wait_event_killable_timeout(wq_head, condition, timeout) \
996 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1002 * @wq_head: the waitqueue to wait on
1008 * The @condition is checked each time the waitqueue @wq_head is woken up.
1022 #define wait_event_killable_timeout(wq_head, condition, timeout) \
1027 __ret = __wait_event_killable_timeout(wq_head, \
1033 #define __wait_event_lock_irq(wq_head, condition, lock, cmd) \
1034 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
1045 * @wq_head: the waitqueue to wait on
1054 * the waitqueue @wq_head is woken up.
1063 #define wait_event_lock_irq_cmd(wq_head, condition, lock, cmd) \
1067 __wait_event_lock_irq(wq_head, condition, lock, cmd); \
1075 * @wq_head: the waitqueue to wait on
1082 * the waitqueue @wq_head is woken up.
1090 #define wait_event_lock_irq(wq_head, condition, lock) \
1094 __wait_event_lock_irq(wq_head, condition, lock, ); \
1098 #define __wait_event_interruptible_lock_irq(wq_head, condition, lock, cmd) \
1099 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
1109 * @wq_head: the waitqueue to wait on
1118 * checked each time the waitqueue @wq_head is woken up.
1130 #define wait_event_interruptible_lock_irq_cmd(wq_head, condition, lock, cmd) \
1134 __ret = __wait_event_interruptible_lock_irq(wq_head, \
1143 * @wq_head: the waitqueue to wait on
1150 * checked each time the waitqueue @wq_head is woken up.
1161 #define wait_event_interruptible_lock_irq(wq_head, condition, lock) \
1165 __ret = __wait_event_interruptible_lock_irq(wq_head, \
1170 #define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \
1171 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1181 * @wq_head: the waitqueue to wait on
1189 * checked each time the waitqueue @wq_head is woken up.
1201 #define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \
1207 wq_head, condition, lock, timeout, \
1212 #define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \
1217 wq_head, condition, lock, timeout, \
1225 void prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1226 bool prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1227 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state);
1228 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);