Lines Matching full:condition
274 #define ___wait_cond_timeout(condition) \ argument
276 bool __cond = (condition); \
293 * to wrap the condition.
300 #define ___wait_event(wq_head, condition, state, exclusive, ret, cmd) \ argument
310 if (condition) \
324 #define __wait_event(wq_head, condition) \ argument
325 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
329 * wait_event - sleep until a condition gets true
331 * @condition: a C expression for the event to wait for
334 * @condition evaluates to true. The @condition is checked each time
338 * change the result of the wait condition.
340 #define wait_event(wq_head, condition) \ argument
343 if (condition) \
345 __wait_event(wq_head, condition); \
348 #define __io_wait_event(wq_head, condition) \ argument
349 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
355 #define io_wait_event(wq_head, condition) \ argument
358 if (condition) \
360 __io_wait_event(wq_head, condition); \
363 #define __wait_event_freezable(wq_head, condition) \ argument
364 ___wait_event(wq_head, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), \
368 * wait_event_freezable - sleep (or freeze) until a condition gets true
370 * @condition: a C expression for the event to wait for
373 * to system load) until the @condition evaluates to true. The
374 * @condition is checked each time the waitqueue @wq_head is woken up.
377 * change the result of the wait condition.
379 #define wait_event_freezable(wq_head, condition) \ argument
383 if (!(condition)) \
384 __ret = __wait_event_freezable(wq_head, condition); \
388 #define __wait_event_timeout(wq_head, condition, timeout) \ argument
389 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
394 * wait_event_timeout - sleep until a condition gets true or a timeout elapses
396 * @condition: a C expression for the event to wait for
400 * @condition evaluates to true. The @condition is checked each time
404 * change the result of the wait condition.
407 * 0 if the @condition evaluated to %false after the @timeout elapsed,
408 * 1 if the @condition evaluated to %true after the @timeout elapsed,
409 * or the remaining jiffies (at least 1) if the @condition evaluated
412 #define wait_event_timeout(wq_head, condition, timeout) \ argument
416 if (!___wait_cond_timeout(condition)) \
417 __ret = __wait_event_timeout(wq_head, condition, timeout); \
421 #define __wait_event_freezable_timeout(wq_head, condition, timeout) \ argument
422 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
430 #define wait_event_freezable_timeout(wq_head, condition, timeout) \ argument
434 if (!___wait_cond_timeout(condition)) \
435 __ret = __wait_event_freezable_timeout(wq_head, condition, timeout); \
439 #define __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \ argument
440 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 1, 0, \
445 #define wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \ argument
447 if (condition) \
449 __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2); \
452 #define __wait_event_cmd(wq_head, condition, cmd1, cmd2) \ argument
453 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
457 * wait_event_cmd - sleep until a condition gets true
459 * @condition: a C expression for the event to wait for
464 * @condition evaluates to true. The @condition is checked each time
468 * change the result of the wait condition.
470 #define wait_event_cmd(wq_head, condition, cmd1, cmd2) \ argument
472 if (condition) \
474 __wait_event_cmd(wq_head, condition, cmd1, cmd2); \
477 #define __wait_event_interruptible(wq_head, condition) \ argument
478 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
482 * wait_event_interruptible - sleep until a condition gets true
484 * @condition: a C expression for the event to wait for
487 * @condition evaluates to true or a signal is received.
488 * The @condition is checked each time the waitqueue @wq_head is woken up.
491 * change the result of the wait condition.
494 * signal and 0 if @condition evaluated to true.
496 #define wait_event_interruptible(wq_head, condition) \ argument
500 if (!(condition)) \
501 __ret = __wait_event_interruptible(wq_head, condition); \
505 #define __wait_event_interruptible_timeout(wq_head, condition, timeout) \ argument
506 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
511 * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses
513 * @condition: a C expression for the event to wait for
517 * @condition evaluates to true or a signal is received.
518 * The @condition is checked each time the waitqueue @wq_head is woken up.
521 * change the result of the wait condition.
524 * 0 if the @condition evaluated to %false after the @timeout elapsed,
525 * 1 if the @condition evaluated to %true after the @timeout elapsed,
526 * the remaining jiffies (at least 1) if the @condition evaluated
530 #define wait_event_interruptible_timeout(wq_head, condition, timeout) \ argument
534 if (!___wait_cond_timeout(condition)) \
536 condition, timeout); \
540 #define __wait_event_hrtimeout(wq_head, condition, timeout, state) \ argument
553 __ret = ___wait_event(wq_head, condition, state, 0, 0, \
566 * wait_event_hrtimeout - sleep until a condition gets true or a timeout elapses
568 * @condition: a C expression for the event to wait for
572 * @condition evaluates to true or a signal is received.
573 * The @condition is checked each time the waitqueue @wq_head is woken up.
576 * change the result of the wait condition.
578 * The function returns 0 if @condition became true, or -ETIME if the timeout
581 #define wait_event_hrtimeout(wq_head, condition, timeout) \ argument
585 if (!(condition)) \
586 __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \
592 * wait_event_interruptible_hrtimeout - sleep until a condition gets true or a timeout elapses
594 * @condition: a C expression for the event to wait for
598 * @condition evaluates to true or a signal is received.
599 * The @condition is checked each time the waitqueue @wq is woken up.
602 * change the result of the wait condition.
604 * The function returns 0 if @condition became true, -ERESTARTSYS if it was
607 #define wait_event_interruptible_hrtimeout(wq, condition, timeout) \ argument
611 if (!(condition)) \
612 __ret = __wait_event_hrtimeout(wq, condition, timeout, \
617 #define __wait_event_interruptible_exclusive(wq, condition) \ argument
618 ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \
621 #define wait_event_interruptible_exclusive(wq, condition) \ argument
625 if (!(condition)) \
626 __ret = __wait_event_interruptible_exclusive(wq, condition); \
630 #define __wait_event_killable_exclusive(wq, condition) \ argument
631 ___wait_event(wq, condition, TASK_KILLABLE, 1, 0, \
634 #define wait_event_killable_exclusive(wq, condition) \ argument
638 if (!(condition)) \
639 __ret = __wait_event_killable_exclusive(wq, condition); \
644 #define __wait_event_freezable_exclusive(wq, condition) \ argument
645 ___wait_event(wq, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), 1, 0,\
648 #define wait_event_freezable_exclusive(wq, condition) \ argument
652 if (!(condition)) \
653 __ret = __wait_event_freezable_exclusive(wq, condition); \
658 * wait_event_idle - wait for a condition without contributing to system load
660 * @condition: a C expression for the event to wait for
663 * @condition evaluates to true.
664 * The @condition is checked each time the waitqueue @wq_head is woken up.
667 * change the result of the wait condition.
670 #define wait_event_idle(wq_head, condition) \ argument
673 if (!(condition)) \
674 ___wait_event(wq_head, condition, TASK_IDLE, 0, 0, schedule()); \
678 * wait_event_idle_exclusive - wait for a condition with contributing to system load
680 * @condition: a C expression for the event to wait for
683 * @condition evaluates to true.
684 * The @condition is checked each time the waitqueue @wq_head is woken up.
691 * change the result of the wait condition.
694 #define wait_event_idle_exclusive(wq_head, condition) \ argument
697 if (!(condition)) \
698 ___wait_event(wq_head, condition, TASK_IDLE, 1, 0, schedule()); \
701 #define __wait_event_idle_timeout(wq_head, condition, timeout) \ argument
702 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
707 * wait_event_idle_timeout - sleep without load until a condition becomes true or a timeout elapses
709 * @condition: a C expression for the event to wait for
713 * @condition evaluates to true. The @condition is checked each time
717 * change the result of the wait condition.
720 * 0 if the @condition evaluated to %false after the @timeout elapsed,
721 * 1 if the @condition evaluated to %true after the @timeout elapsed,
722 * or the remaining jiffies (at least 1) if the @condition evaluated
725 #define wait_event_idle_timeout(wq_head, condition, timeout) \ argument
729 if (!___wait_cond_timeout(condition)) \
730 __ret = __wait_event_idle_timeout(wq_head, condition, timeout); \
734 #define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \ argument
735 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
740 …* wait_event_idle_exclusive_timeout - sleep without load until a condition becomes true or a timeo…
742 * @condition: a C expression for the event to wait for
746 * @condition evaluates to true. The @condition is checked each time
754 * change the result of the wait condition.
757 * 0 if the @condition evaluated to %false after the @timeout elapsed,
758 * 1 if the @condition evaluated to %true after the @timeout elapsed,
759 * or the remaining jiffies (at least 1) if the @condition evaluated
762 #define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \ argument
766 if (!___wait_cond_timeout(condition)) \
767 __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
774 #define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \ argument
784 } while (!(condition)); \
792 * wait_event_interruptible_locked - sleep until a condition gets true
794 * @condition: a C expression for the event to wait for
797 * @condition evaluates to true or a signal is received.
798 * The @condition is checked each time the waitqueue @wq is woken up.
801 * unlocked while sleeping but @condition testing is done while lock
809 * change the result of the wait condition.
812 * signal and 0 if @condition evaluated to true.
814 #define wait_event_interruptible_locked(wq, condition) \ argument
815 ((condition) \
816 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr))
819 * wait_event_interruptible_locked_irq - sleep until a condition gets true
821 * @condition: a C expression for the event to wait for
824 * @condition evaluates to true or a signal is received.
825 * The @condition is checked each time the waitqueue @wq is woken up.
828 * unlocked while sleeping but @condition testing is done while lock
836 * change the result of the wait condition.
839 * signal and 0 if @condition evaluated to true.
841 #define wait_event_interruptible_locked_irq(wq, condition) \ argument
842 ((condition) \
843 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr_irq))
846 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true
848 * @condition: a C expression for the event to wait for
851 * @condition evaluates to true or a signal is received.
852 * The @condition is checked each time the waitqueue @wq is woken up.
855 * unlocked while sleeping but @condition testing is done while lock
867 * change the result of the wait condition.
870 * signal and 0 if @condition evaluated to true.
872 #define wait_event_interruptible_exclusive_locked(wq, condition) \ argument
873 ((condition) \
874 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr))
877 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
879 * @condition: a C expression for the event to wait for
882 * @condition evaluates to true or a signal is received.
883 * The @condition is checked each time the waitqueue @wq is woken up.
886 * unlocked while sleeping but @condition testing is done while lock
898 * change the result of the wait condition.
901 * signal and 0 if @condition evaluated to true.
903 #define wait_event_interruptible_exclusive_locked_irq(wq, condition) \ argument
904 ((condition) \
905 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr_irq))
908 #define __wait_event_killable(wq, condition) \ argument
909 ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, schedule())
912 * wait_event_killable - sleep until a condition gets true
914 * @condition: a C expression for the event to wait for
917 * @condition evaluates to true or a signal is received.
918 * The @condition is checked each time the waitqueue @wq_head is woken up.
921 * change the result of the wait condition.
924 * signal and 0 if @condition evaluated to true.
926 #define wait_event_killable(wq_head, condition) \ argument
930 if (!(condition)) \
931 __ret = __wait_event_killable(wq_head, condition); \
935 #define __wait_event_state(wq, condition, state) \ argument
936 ___wait_event(wq, condition, state, 0, 0, schedule())
939 * wait_event_state - sleep until a condition gets true
941 * @condition: a C expression for the event to wait for
944 * The process is put to sleep (@state) until the @condition evaluates to true
945 * or a signal is received (when allowed by @state). The @condition is checked
949 * change the result of the wait condition.
952 * (when allowed by @state) and 0 if @condition evaluated to true.
954 #define wait_event_state(wq_head, condition, state) \ argument
958 if (!(condition)) \
959 __ret = __wait_event_state(wq_head, condition, state); \
963 #define __wait_event_killable_timeout(wq_head, condition, timeout) \ argument
964 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
969 * wait_event_killable_timeout - sleep until a condition gets true or a timeout elapses
971 * @condition: a C expression for the event to wait for
975 * @condition evaluates to true or a kill signal is received.
976 * The @condition is checked each time the waitqueue @wq_head is woken up.
979 * change the result of the wait condition.
982 * 0 if the @condition evaluated to %false after the @timeout elapsed,
983 * 1 if the @condition evaluated to %true after the @timeout elapsed,
984 * the remaining jiffies (at least 1) if the @condition evaluated
990 #define wait_event_killable_timeout(wq_head, condition, timeout) \ argument
994 if (!___wait_cond_timeout(condition)) \
996 condition, timeout); \
1001 #define __wait_event_lock_irq(wq_head, condition, lock, cmd) \ argument
1002 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
1009 * wait_event_lock_irq_cmd - sleep until a condition gets true. The
1010 * condition is checked under the lock. This
1014 * @condition: a C expression for the event to wait for
1021 * @condition evaluates to true. The @condition is checked each time
1025 * change the result of the wait condition.
1031 #define wait_event_lock_irq_cmd(wq_head, condition, lock, cmd) \ argument
1033 if (condition) \
1035 __wait_event_lock_irq(wq_head, condition, lock, cmd); \
1039 * wait_event_lock_irq - sleep until a condition gets true. The
1040 * condition is checked under the lock. This
1044 * @condition: a C expression for the event to wait for
1049 * @condition evaluates to true. The @condition is checked each time
1053 * change the result of the wait condition.
1058 #define wait_event_lock_irq(wq_head, condition, lock) \ argument
1060 if (condition) \
1062 __wait_event_lock_irq(wq_head, condition, lock, ); \
1066 #define __wait_event_interruptible_lock_irq(wq_head, condition, lock, cmd) \ argument
1067 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
1074 * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true.
1075 * The condition is checked under the lock. This is expected to
1078 * @condition: a C expression for the event to wait for
1085 * @condition evaluates to true or a signal is received. The @condition is
1089 * change the result of the wait condition.
1096 * and 0 if @condition evaluated to true.
1098 #define wait_event_interruptible_lock_irq_cmd(wq_head, condition, lock, cmd) \ argument
1101 if (!(condition)) \
1103 condition, lock, cmd); \
1108 * wait_event_interruptible_lock_irq - sleep until a condition gets true.
1109 * The condition is checked under the lock. This is expected
1112 * @condition: a C expression for the event to wait for
1117 * @condition evaluates to true or signal is received. The @condition is
1121 * change the result of the wait condition.
1127 * and 0 if @condition evaluated to true.
1129 #define wait_event_interruptible_lock_irq(wq_head, condition, lock) \ argument
1132 if (!(condition)) \
1134 condition, lock,); \
1138 #define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \ argument
1139 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1146 * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets
1147 * true or a timeout elapses. The condition is checked under
1150 * @condition: a C expression for the event to wait for
1156 * @condition evaluates to true or signal is received. The @condition is
1160 * change the result of the wait condition.
1167 * if the condition evaluated to true before the timeout elapsed.
1169 #define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \ argument
1173 if (!___wait_cond_timeout(condition)) \
1175 wq_head, condition, lock, timeout, \
1180 #define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \ argument
1183 if (!___wait_cond_timeout(condition)) \
1185 wq_head, condition, lock, timeout, \