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) \
320 if (condition) \
327 #define __wait_event(wq_head, condition) \ argument
328 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
332 * wait_event - sleep until a condition gets true
334 * @condition: a C expression for the event to wait for
337 * @condition evaluates to true. The @condition is checked each time
341 * change the result of the wait condition.
343 #define wait_event(wq_head, condition) \ argument
346 if (condition) \
348 __wait_event(wq_head, condition); \
351 #define __io_wait_event(wq_head, condition) \ argument
352 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
358 #define io_wait_event(wq_head, condition) \ argument
361 if (condition) \
363 __io_wait_event(wq_head, condition); \
366 #define __wait_event_freezable(wq_head, condition) \ argument
367 ___wait_event(wq_head, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), \
371 * wait_event_freezable - sleep (or freeze) until a condition gets true
373 * @condition: a C expression for the event to wait for
376 * to system load) until the @condition evaluates to true. The
377 * @condition is checked each time the waitqueue @wq_head is woken up.
380 * change the result of the wait condition.
382 #define wait_event_freezable(wq_head, condition) \ argument
386 if (!(condition)) \
387 __ret = __wait_event_freezable(wq_head, condition); \
391 #define __wait_event_timeout(wq_head, condition, timeout) \ argument
392 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
397 * wait_event_timeout - sleep until a condition gets true or a timeout elapses
399 * @condition: a C expression for the event to wait for
403 * @condition evaluates to true. The @condition is checked each time
407 * change the result of the wait condition.
410 * 0 if the @condition evaluated to %false after the @timeout elapsed,
411 * 1 if the @condition evaluated to %true after the @timeout elapsed,
412 * or the remaining jiffies (at least 1) if the @condition evaluated
415 #define wait_event_timeout(wq_head, condition, timeout) \ argument
419 if (!___wait_cond_timeout(condition)) \
420 __ret = __wait_event_timeout(wq_head, condition, timeout); \
424 #define __wait_event_freezable_timeout(wq_head, condition, timeout) \ argument
425 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
433 #define wait_event_freezable_timeout(wq_head, condition, timeout) \ argument
437 if (!___wait_cond_timeout(condition)) \
438 __ret = __wait_event_freezable_timeout(wq_head, condition, timeout); \
442 #define __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \ argument
443 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 1, 0, \
448 #define wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2) \ argument
450 if (condition) \
452 __wait_event_exclusive_cmd(wq_head, condition, cmd1, cmd2); \
455 #define __wait_event_cmd(wq_head, condition, cmd1, cmd2) \ argument
456 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
460 * wait_event_cmd - sleep until a condition gets true
462 * @condition: a C expression for the event to wait for
467 * @condition evaluates to true. The @condition is checked each time
471 * change the result of the wait condition.
473 #define wait_event_cmd(wq_head, condition, cmd1, cmd2) \ argument
475 if (condition) \
477 __wait_event_cmd(wq_head, condition, cmd1, cmd2); \
480 #define __wait_event_interruptible(wq_head, condition) \ argument
481 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
485 * wait_event_interruptible - sleep until a condition gets true
487 * @condition: a C expression for the event to wait for
490 * @condition evaluates to true or a signal is received.
491 * The @condition is checked each time the waitqueue @wq_head is woken up.
494 * change the result of the wait condition.
497 * signal and 0 if @condition evaluated to true.
499 #define wait_event_interruptible(wq_head, condition) \ argument
503 if (!(condition)) \
504 __ret = __wait_event_interruptible(wq_head, condition); \
508 #define __wait_event_interruptible_timeout(wq_head, condition, timeout) \ argument
509 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
514 * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses
516 * @condition: a C expression for the event to wait for
520 * @condition evaluates to true or a signal is received.
521 * The @condition is checked each time the waitqueue @wq_head is woken up.
524 * change the result of the wait condition.
527 * 0 if the @condition evaluated to %false after the @timeout elapsed,
528 * 1 if the @condition evaluated to %true after the @timeout elapsed,
529 * the remaining jiffies (at least 1) if the @condition evaluated
533 #define wait_event_interruptible_timeout(wq_head, condition, timeout) \ argument
537 if (!___wait_cond_timeout(condition)) \
539 condition, timeout); \
543 #define __wait_event_hrtimeout(wq_head, condition, timeout, state) \ argument
556 __ret = ___wait_event(wq_head, condition, state, 0, 0, \
569 * wait_event_hrtimeout - sleep until a condition gets true or a timeout elapses
571 * @condition: a C expression for the event to wait for
575 * @condition evaluates to true or a signal is received.
576 * The @condition is checked each time the waitqueue @wq_head is woken up.
579 * change the result of the wait condition.
581 * The function returns 0 if @condition became true, or -ETIME if the timeout
584 #define wait_event_hrtimeout(wq_head, condition, timeout) \ argument
588 if (!(condition)) \
589 __ret = __wait_event_hrtimeout(wq_head, condition, timeout, \
595 * wait_event_interruptible_hrtimeout - sleep until a condition gets true or a timeout elapses
597 * @condition: a C expression for the event to wait for
601 * @condition evaluates to true or a signal is received.
602 * The @condition is checked each time the waitqueue @wq is woken up.
605 * change the result of the wait condition.
607 * The function returns 0 if @condition became true, -ERESTARTSYS if it was
610 #define wait_event_interruptible_hrtimeout(wq, condition, timeout) \ argument
614 if (!(condition)) \
615 __ret = __wait_event_hrtimeout(wq, condition, timeout, \
620 #define __wait_event_interruptible_exclusive(wq, condition) \ argument
621 ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \
624 #define wait_event_interruptible_exclusive(wq, condition) \ argument
628 if (!(condition)) \
629 __ret = __wait_event_interruptible_exclusive(wq, condition); \
633 #define __wait_event_killable_exclusive(wq, condition) \ argument
634 ___wait_event(wq, condition, TASK_KILLABLE, 1, 0, \
637 #define wait_event_killable_exclusive(wq, condition) \ argument
641 if (!(condition)) \
642 __ret = __wait_event_killable_exclusive(wq, condition); \
647 #define __wait_event_freezable_exclusive(wq, condition) \ argument
648 ___wait_event(wq, condition, (TASK_INTERRUPTIBLE|TASK_FREEZABLE), 1, 0,\
651 #define wait_event_freezable_exclusive(wq, condition) \ argument
655 if (!(condition)) \
656 __ret = __wait_event_freezable_exclusive(wq, condition); \
661 * wait_event_idle - wait for a condition without contributing to system load
663 * @condition: a C expression for the event to wait for
666 * @condition evaluates to true.
667 * The @condition is checked each time the waitqueue @wq_head is woken up.
670 * change the result of the wait condition.
673 #define wait_event_idle(wq_head, condition) \ argument
676 if (!(condition)) \
677 ___wait_event(wq_head, condition, TASK_IDLE, 0, 0, schedule()); \
681 * wait_event_idle_exclusive - wait for a condition with contributing to system load
683 * @condition: a C expression for the event to wait for
686 * @condition evaluates to true.
687 * The @condition is checked each time the waitqueue @wq_head is woken up.
694 * change the result of the wait condition.
697 #define wait_event_idle_exclusive(wq_head, condition) \ argument
700 if (!(condition)) \
701 ___wait_event(wq_head, condition, TASK_IDLE, 1, 0, schedule()); \
704 #define __wait_event_idle_timeout(wq_head, condition, timeout) \ argument
705 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
710 * wait_event_idle_timeout - sleep without load until a condition becomes true or a timeout elapses
712 * @condition: a C expression for the event to wait for
716 * @condition evaluates to true. The @condition is checked each time
720 * change the result of the wait condition.
723 * 0 if the @condition evaluated to %false after the @timeout elapsed,
724 * 1 if the @condition evaluated to %true after the @timeout elapsed,
725 * or the remaining jiffies (at least 1) if the @condition evaluated
728 #define wait_event_idle_timeout(wq_head, condition, timeout) \ argument
732 if (!___wait_cond_timeout(condition)) \
733 __ret = __wait_event_idle_timeout(wq_head, condition, timeout); \
737 #define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \ argument
738 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
743 …* wait_event_idle_exclusive_timeout - sleep without load until a condition becomes true or a timeo…
745 * @condition: a C expression for the event to wait for
749 * @condition evaluates to true. The @condition is checked each time
757 * change the result of the wait condition.
760 * 0 if the @condition evaluated to %false after the @timeout elapsed,
761 * 1 if the @condition evaluated to %true after the @timeout elapsed,
762 * or the remaining jiffies (at least 1) if the @condition evaluated
765 #define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \ argument
769 if (!___wait_cond_timeout(condition)) \
770 __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
777 #define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \ argument
787 } while (!(condition)); \
795 * wait_event_interruptible_locked - sleep until a condition gets true
797 * @condition: a C expression for the event to wait for
800 * @condition evaluates to true or a signal is received.
801 * The @condition is checked each time the waitqueue @wq is woken up.
804 * unlocked while sleeping but @condition testing is done while lock
812 * change the result of the wait condition.
815 * signal and 0 if @condition evaluated to true.
817 #define wait_event_interruptible_locked(wq, condition) \ argument
818 ((condition) \
819 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr))
822 * wait_event_interruptible_locked_irq - sleep until a condition gets true
824 * @condition: a C expression for the event to wait for
827 * @condition evaluates to true or a signal is received.
828 * The @condition is checked each time the waitqueue @wq is woken up.
831 * unlocked while sleeping but @condition testing is done while lock
839 * change the result of the wait condition.
842 * signal and 0 if @condition evaluated to true.
844 #define wait_event_interruptible_locked_irq(wq, condition) \ argument
845 ((condition) \
846 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr_irq))
849 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true
851 * @condition: a C expression for the event to wait for
854 * @condition evaluates to true or a signal is received.
855 * The @condition is checked each time the waitqueue @wq is woken up.
858 * unlocked while sleeping but @condition testing is done while lock
870 * change the result of the wait condition.
873 * signal and 0 if @condition evaluated to true.
875 #define wait_event_interruptible_exclusive_locked(wq, condition) \ argument
876 ((condition) \
877 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr))
880 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
882 * @condition: a C expression for the event to wait for
885 * @condition evaluates to true or a signal is received.
886 * The @condition is checked each time the waitqueue @wq is woken up.
889 * unlocked while sleeping but @condition testing is done while lock
901 * change the result of the wait condition.
904 * signal and 0 if @condition evaluated to true.
906 #define wait_event_interruptible_exclusive_locked_irq(wq, condition) \ argument
907 ((condition) \
908 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr_irq))
911 #define __wait_event_killable(wq, condition) \ argument
912 ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, schedule())
915 * wait_event_killable - sleep until a condition gets true
917 * @condition: a C expression for the event to wait for
920 * @condition evaluates to true or a signal is received.
921 * The @condition is checked each time the waitqueue @wq_head is woken up.
924 * change the result of the wait condition.
927 * signal and 0 if @condition evaluated to true.
929 #define wait_event_killable(wq_head, condition) \ argument
933 if (!(condition)) \
934 __ret = __wait_event_killable(wq_head, condition); \
938 #define __wait_event_state(wq, condition, state) \ argument
939 ___wait_event(wq, condition, state, 0, 0, schedule())
942 * wait_event_state - sleep until a condition gets true
944 * @condition: a C expression for the event to wait for
947 * The process is put to sleep (@state) until the @condition evaluates to true
948 * or a signal is received (when allowed by @state). The @condition is checked
952 * change the result of the wait condition.
955 * (when allowed by @state) and 0 if @condition evaluated to true.
957 #define wait_event_state(wq_head, condition, state) \ argument
961 if (!(condition)) \
962 __ret = __wait_event_state(wq_head, condition, state); \
966 #define __wait_event_killable_timeout(wq_head, condition, timeout) \ argument
967 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
972 * wait_event_killable_timeout - sleep until a condition gets true or a timeout elapses
974 * @condition: a C expression for the event to wait for
978 * @condition evaluates to true or a kill signal is received.
979 * The @condition is checked each time the waitqueue @wq_head is woken up.
982 * change the result of the wait condition.
985 * 0 if the @condition evaluated to %false after the @timeout elapsed,
986 * 1 if the @condition evaluated to %true after the @timeout elapsed,
987 * the remaining jiffies (at least 1) if the @condition evaluated
993 #define wait_event_killable_timeout(wq_head, condition, timeout) \ argument
997 if (!___wait_cond_timeout(condition)) \
999 condition, timeout); \
1004 #define __wait_event_lock_irq(wq_head, condition, lock, cmd) \ argument
1005 (void)___wait_event(wq_head, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
1012 * wait_event_lock_irq_cmd - sleep until a condition gets true. The
1013 * condition is checked under the lock. This
1017 * @condition: a C expression for the event to wait for
1024 * @condition evaluates to true. The @condition is checked each time
1028 * change the result of the wait condition.
1034 #define wait_event_lock_irq_cmd(wq_head, condition, lock, cmd) \ argument
1036 if (condition) \
1038 __wait_event_lock_irq(wq_head, condition, lock, cmd); \
1042 * wait_event_lock_irq - sleep until a condition gets true. The
1043 * condition is checked under the lock. This
1047 * @condition: a C expression for the event to wait for
1052 * @condition evaluates to true. The @condition is checked each time
1056 * change the result of the wait condition.
1061 #define wait_event_lock_irq(wq_head, condition, lock) \ argument
1063 if (condition) \
1065 __wait_event_lock_irq(wq_head, condition, lock, ); \
1069 #define __wait_event_interruptible_lock_irq(wq_head, condition, lock, cmd) \ argument
1070 ___wait_event(wq_head, condition, TASK_INTERRUPTIBLE, 0, 0, \
1077 * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true.
1078 * The condition is checked under the lock. This is expected to
1081 * @condition: a C expression for the event to wait for
1088 * @condition evaluates to true or a signal is received. The @condition is
1092 * change the result of the wait condition.
1099 * and 0 if @condition evaluated to true.
1101 #define wait_event_interruptible_lock_irq_cmd(wq_head, condition, lock, cmd) \ argument
1104 if (!(condition)) \
1106 condition, lock, cmd); \
1111 * wait_event_interruptible_lock_irq - sleep until a condition gets true.
1112 * The condition is checked under the lock. This is expected
1115 * @condition: a C expression for the event to wait for
1120 * @condition evaluates to true or signal is received. The @condition is
1124 * change the result of the wait condition.
1130 * and 0 if @condition evaluated to true.
1132 #define wait_event_interruptible_lock_irq(wq_head, condition, lock) \ argument
1135 if (!(condition)) \
1137 condition, lock,); \
1141 #define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \ argument
1142 ___wait_event(wq_head, ___wait_cond_timeout(condition), \
1149 * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets
1150 * true or a timeout elapses. The condition is checked under
1153 * @condition: a C expression for the event to wait for
1159 * @condition evaluates to true or signal is received. The @condition is
1163 * change the result of the wait condition.
1170 * if the condition evaluated to true before the timeout elapsed.
1172 #define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \ argument
1176 if (!___wait_cond_timeout(condition)) \
1178 wq_head, condition, lock, timeout, \
1183 #define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \ argument
1186 if (!___wait_cond_timeout(condition)) \
1188 wq_head, condition, lock, timeout, \