diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-07-19 03:04:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-07-19 03:08:07 -0400 |
commit | 6a0fb306738994d6f091791aeb11a5dc87ad8f4c (patch) | |
tree | a340fe7ddd7a023d88a721ea32e358966a17c17c | |
parent | 6d4e56ce977864b0fcd28c61555060e6010aa89b (diff) |
new helper: wait_event_killable_exclusive()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | include/linux/wait.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index 27d7a0ab5da3..c3ff74d764fa 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -600,6 +600,19 @@ do { \ | |||
600 | __ret; \ | 600 | __ret; \ |
601 | }) | 601 | }) |
602 | 602 | ||
603 | #define __wait_event_killable_exclusive(wq, condition) \ | ||
604 | ___wait_event(wq, condition, TASK_KILLABLE, 1, 0, \ | ||
605 | schedule()) | ||
606 | |||
607 | #define wait_event_killable_exclusive(wq, condition) \ | ||
608 | ({ \ | ||
609 | int __ret = 0; \ | ||
610 | might_sleep(); \ | ||
611 | if (!(condition)) \ | ||
612 | __ret = __wait_event_killable_exclusive(wq, condition); \ | ||
613 | __ret; \ | ||
614 | }) | ||
615 | |||
603 | 616 | ||
604 | #define __wait_event_freezable_exclusive(wq, condition) \ | 617 | #define __wait_event_freezable_exclusive(wq, condition) \ |
605 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ | 618 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ |