From 6a0fb306738994d6f091791aeb11a5dc87ad8f4c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 19 Jul 2016 03:04:34 -0400 Subject: [PATCH] new helper: wait_event_killable_exclusive() Signed-off-by: Al Viro --- include/linux/wait.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 { \ __ret; \ }) +#define __wait_event_killable_exclusive(wq, condition) \ + ___wait_event(wq, condition, TASK_KILLABLE, 1, 0, \ + schedule()) + +#define wait_event_killable_exclusive(wq, condition) \ +({ \ + int __ret = 0; \ + might_sleep(); \ + if (!(condition)) \ + __ret = __wait_event_killable_exclusive(wq, condition); \ + __ret; \ +}) + #define __wait_event_freezable_exclusive(wq, condition) \ ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ -- 2.20.1