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 27d7a0ab5da3edf217e60d767c10c65d3e3c52a0..c3ff74d764faad094e7f00dcd025ddb568a6382d 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,          \