new helper: wait_event_killable_exclusive()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jul 2016 07:04:34 +0000 (03:04 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jul 2016 07:08:07 +0000 (03:08 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/wait.h

index 27d7a0a..c3ff74d 100644 (file)
@@ -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,          \