Lines Matching refs:condition

273 #define ___wait_cond_timeout(condition)						\
275 bool __cond = (condition); \
292 * to wrap the condition.
299 #define ___wait_event(wq_head, condition, state, exclusive, ret, cmd) \
309 if (condition) \
323 #define __wait_event(wq_head, condition) \
324 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
328 * wait_event - sleep until a condition gets true
330 * @condition: a C expression for the event to wait for
333 * @condition evaluates to true. The @condition is checked each time
337 * change the result of the wait condition.
339 #define wait_event(wq_head, condition) \
342 if (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) \
357 if (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), \
367 * wait_event_freezable - sleep (or freeze) until a condition gets true
369 * @condition: a C expression for the event to wait for
372 * to system load) until the @condition evaluates to true. The
373 * @condition is checked each time the waitqueue @wq_head is woken up.
376 * change the result of the wait condition.
378 #define wait_event_freezable(wq_head, condition) \
382 if (!(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), \
393 * wait_event_timeout - sleep until a condition gets true or a timeout elapses
395 * @condition: a C expression for the event to wait for
399 * @condition evaluates to true. The @condition is checked each time
403 * change the result of the wait condition.
406 * 0 if the @condition evaluated to %false after the @timeout elapsed,
407 * 1 if the @condition evaluated to %true after the @timeout elapsed,
408 * or the remaining jiffies (at least 1) if the @condition evaluated
411 #define wait_event_timeout(wq_head, condition, timeout) \
415 if (!___wait_cond_timeout(condition)) \
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) \
433 if (!___wait_cond_timeout(condition)) \
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) \
446 if (condition) \
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, \
456 * wait_event_cmd - sleep until a condition gets true
458 * @condition: a C expression for the event to wait for
463 * @condition evaluates to true. The @condition is checked each time
467 * change the result of the wait condition.
469 #define wait_event_cmd(wq_head, condition, cmd1, cmd2) \
471 if (condition) \
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, \
481 * wait_event_interruptible - sleep until a condition gets true
483 * @condition: a C expression for the event to wait for
486 * @condition evaluates to true or a signal is received.
487 * The @condition is checked each time the waitqueue @wq_head is woken up.
490 * change the result of the wait condition.
493 * signal and 0 if @condition evaluated to true.
495 #define wait_event_interruptible(wq_head, condition) \
499 if (!(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), \
510 * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses
512 * @condition: a C expression for the event to wait for
516 * @condition evaluates to true or a signal is received.
517 * The @condition is checked each time the waitqueue @wq_head is woken up.
520 * change the result of the wait condition.
523 * 0 if the @condition evaluated to %false after the @timeout elapsed,
524 * 1 if the @condition evaluated to %true after the @timeout elapsed,
525 * the remaining jiffies (at least 1) if the @condition evaluated
529 #define wait_event_interruptible_timeout(wq_head, condition, timeout) \
533 if (!___wait_cond_timeout(condition)) \
535 condition, timeout); \
539 #define __wait_event_hrtimeout(wq_head, condition, timeout, state) \
552 __ret = ___wait_event(wq_head, condition, state, 0, 0, \
565 * wait_event_hrtimeout - sleep until a condition gets true or a timeout elapses
567 * @condition: a C expression for the event to wait for
571 * @condition evaluates to true or a signal is received.
572 * The @condition is checked each time the waitqueue @wq_head is woken up.
575 * change the result of the wait condition.
577 * The function returns 0 if @condition became true, or -ETIME if the timeout
580 #define wait_event_hrtimeout(wq_head, condition, timeout) \
584 if (!(condition)) \
585 __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \
591 * wait_event_interruptible_hrtimeout - sleep until a condition gets true or a timeout elapses
593 * @condition: a C expression for the event to wait for
597 * @condition evaluates to true or a signal is received.
598 * The @condition is checked each time the waitqueue @wq is woken up.
601 * change the result of the wait condition.
603 * The function returns 0 if @condition became true, -ERESTARTSYS if it was
606 #define wait_event_interruptible_hrtimeout(wq, condition, timeout) \
610 if (!(condition)) \
611 __ret = __wait_event_hrtimeout(wq, condition, timeout, \
616 #define __wait_event_interruptible_exclusive(wq, condition) \
617 ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \
620 #define wait_event_interruptible_exclusive(wq, condition) \
624 if (!(condition)) \
625 __ret = __wait_event_interruptible_exclusive(wq, condition); \
629 #define __wait_event_killable_exclusive(wq, condition) \
630 ___wait_event(wq, condition, TASK_KILLABLE, 1, 0, \
633 #define wait_event_killable_exclusive(wq, condition) \
637 if (!(condition)) \
638 __ret = __wait_event_killable_exclusive(wq, condition); \
643 #define __wait_event_freezable_exclusive(wq, condition) \
644 ___wait_event(wq, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), 1, 0,\
647 #define wait_event_freezable_exclusive(wq, condition) \
651 if (!(condition)) \
652 __ret = __wait_event_freezable_exclusive(wq, condition); \
657 * wait_event_idle - wait for a condition without contributing to system load
659 * @condition: a C expression for the event to wait for
662 * @condition evaluates to true.
663 * The @condition is checked each time the waitqueue @wq_head is woken up.
666 * change the result of the wait condition.
669 #define wait_event_idle(wq_head, condition) \
672 if (!(condition)) \
673 ___wait_event(wq_head, condition, TASK_IDLE, 0, 0, schedule()); \
677 * wait_event_idle_exclusive - wait for a condition with contributing to system load
679 * @condition: a C expression for the event to wait for
682 * @condition evaluates to true.
683 * The @condition is checked each time the waitqueue @wq_head is woken up.
690 * change the result of the wait condition.
693 #define wait_event_idle_exclusive(wq_head, condition) \
696 if (!(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), \
706 * wait_event_idle_timeout - sleep without load until a condition becomes true or a timeout elapses
708 * @condition: a C expression for the event to wait for
712 * @condition evaluates to true. The @condition is checked each time
716 * change the result of the wait condition.
719 * 0 if the @condition evaluated to %false after the @timeout elapsed,
720 * 1 if the @condition evaluated to %true after the @timeout elapsed,
721 * or the remaining jiffies (at least 1) if the @condition evaluated
724 #define wait_event_idle_timeout(wq_head, condition, timeout) \
728 if (!___wait_cond_timeout(condition)) \
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), \
739 * wait_event_idle_exclusive_timeout - sleep without load until a condition becomes true or a timeout elapses
741 * @condition: a C expression for the event to wait for
745 * @condition evaluates to true. The @condition is checked each time
753 * change the result of the wait condition.
756 * 0 if the @condition evaluated to %false after the @timeout elapsed,
757 * 1 if the @condition evaluated to %true after the @timeout elapsed,
758 * or the remaining jiffies (at least 1) if the @condition evaluated
761 #define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
765 if (!___wait_cond_timeout(condition)) \
766 __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
773 #define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \
783 } while (!(condition)); \
791 * wait_event_interruptible_locked - sleep until a condition gets true
793 * @condition: a C expression for the event to wait for
796 * @condition evaluates to true or a signal is received.
797 * The @condition is checked each time the waitqueue @wq is woken up.
800 * unlocked while sleeping but @condition testing is done while lock
808 * change the result of the wait condition.
811 * signal and 0 if @condition evaluated to true.
813 #define wait_event_interruptible_locked(wq, condition) \
814 ((condition) \
815 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr))
818 * wait_event_interruptible_locked_irq - sleep until a condition gets true
820 * @condition: a C expression for the event to wait for
823 * @condition evaluates to true or a signal is received.
824 * The @condition is checked each time the waitqueue @wq is woken up.
827 * unlocked while sleeping but @condition testing is done while lock
835 * change the result of the wait condition.
838 * signal and 0 if @condition evaluated to true.
840 #define wait_event_interruptible_locked_irq(wq, condition) \
841 ((condition) \
842 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr_irq))
845 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true
847 * @condition: a C expression for the event to wait for
850 * @condition evaluates to true or a signal is received.
851 * The @condition is checked each time the waitqueue @wq is woken up.
854 * unlocked while sleeping but @condition testing is done while lock
866 * change the result of the wait condition.
869 * signal and 0 if @condition evaluated to true.
871 #define wait_event_interruptible_exclusive_locked(wq, condition) \
872 ((condition) \
873 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr))
876 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
878 * @condition: a C expression for the event to wait for
881 * @condition evaluates to true or a signal is received.
882 * The @condition is checked each time the waitqueue @wq is woken up.
885 * unlocked while sleeping but @condition testing is done while lock
897 * change the result of the wait condition.
900 * signal and 0 if @condition evaluated to true.
902 #define wait_event_interruptible_exclusive_locked_irq(wq, condition) \
903 ((condition) \
904 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr_irq))
907 #define __wait_event_killable(wq, condition) \
908 ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, schedule())
911 * wait_event_killable - sleep until a condition gets true
913 * @condition: a C expression for the event to wait for
916 * @condition evaluates to true or a signal is received.
917 * The @condition is checked each time the waitqueue @wq_head is woken up.
920 * change the result of the wait condition.
923 * signal and 0 if @condition evaluated to true.
925 #define wait_event_killable(wq_head, condition) \
929 if (!(condition)) \
930 __ret = __wait_event_killable(wq_head, condition); \
934 #define __wait_event_state(wq, condition, state) \
935 ___wait_event(wq, condition, state, 0, 0, schedule())
938 * wait_event_state - sleep until a condition gets true
940 * @condition: a C expression for the event to wait for
943 * The process is put to sleep (@state) until the @condition evaluates to true
944 * or a signal is received (when allowed by @state). The @condition is checked
948 * change the result of the wait condition.
951 * (when allowed by @state) and 0 if @condition evaluated to true.
953 #define wait_event_state(wq_head, condition, state) \
957 if (!(condition)) \
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), \
968 * wait_event_killable_timeout - sleep until a condition gets true or a timeout elapses
970 * @condition: a C expression for the event to wait for
974 * @condition evaluates to true or a kill signal is received.
975 * The @condition is checked each time the waitqueue @wq_head is woken up.
978 * change the result of the wait condition.
981 * 0 if the @condition evaluated to %false after the @timeout elapsed,
982 * 1 if the @condition evaluated to %true after the @timeout elapsed,
983 * the remaining jiffies (at least 1) if the @condition evaluated
989 #define wait_event_killable_timeout(wq_head, condition, timeout) \
993 if (!___wait_cond_timeout(condition)) \
995 condition, timeout); \
1000 #define __wait_event_lock_irq(wq_head, condition, lock, cmd) \
1001 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
1008 * wait_event_lock_irq_cmd - sleep until a condition gets true. The
1009 * condition is checked under the lock. This
1013 * @condition: a C expression for the event to wait for
1020 * @condition evaluates to true. The @condition is checked each time
1024 * change the result of the wait condition.
1030 #define wait_event_lock_irq_cmd(wq_head, condition, lock, cmd) \
1032 if (condition) \
1034 __wait_event_lock_irq(wq_head, condition, lock, cmd); \
1038 * wait_event_lock_irq - sleep until a condition gets true. The
1039 * condition is checked under the lock. This
1043 * @condition: a C expression for the event to wait for
1048 * @condition evaluates to true. The @condition is checked each time
1052 * change the result of the wait condition.
1057 #define wait_event_lock_irq(wq_head, condition, lock) \
1059 if (condition) \
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, \
1073 * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true.
1074 * The condition is checked under the lock. This is expected to
1077 * @condition: a C expression for the event to wait for
1084 * @condition evaluates to true or a signal is received. The @condition is
1088 * change the result of the wait condition.
1095 * and 0 if @condition evaluated to true.
1097 #define wait_event_interruptible_lock_irq_cmd(wq_head, condition, lock, cmd) \
1100 if (!(condition)) \
1102 condition, lock, cmd); \
1107 * wait_event_interruptible_lock_irq - sleep until a condition gets true.
1108 * The condition is checked under the lock. This is expected
1111 * @condition: a C expression for the event to wait for
1116 * @condition evaluates to true or signal is received. The @condition is
1120 * change the result of the wait condition.
1126 * and 0 if @condition evaluated to true.
1128 #define wait_event_interruptible_lock_irq(wq_head, condition, lock) \
1131 if (!(condition)) \
1133 condition, lock,); \
1137 #define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \
1138 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1145 * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets
1146 * true or a timeout elapses. The condition is checked under
1149 * @condition: a C expression for the event to wait for
1155 * @condition evaluates to true or signal is received. The @condition is
1159 * change the result of the wait condition.
1166 * if the condition evaluated to true before the timeout elapsed.
1168 #define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \
1172 if (!___wait_cond_timeout(condition)) \
1174 wq_head, condition, lock, timeout, \
1179 #define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \
1182 if (!___wait_cond_timeout(condition)) \
1184 wq_head, condition, lock, timeout, \