summaryrefslogtreecommitdiffstats
path: root/include/linux/wait.h
diff options
context:
space:
mode:
authorAl Viro2016-07-19 09:04:34 +0200
committerAl Viro2016-07-19 09:08:07 +0200
commit6a0fb306738994d6f091791aeb11a5dc87ad8f4c (patch)
treea340fe7ddd7a023d88a721ea32e358966a17c17c /include/linux/wait.h
parentposix_acl: de-union a_refcount and a_rcu (diff)
downloadkernel-qcow2-linux-6a0fb306738994d6f091791aeb11a5dc87ad8f4c.tar.gz
kernel-qcow2-linux-6a0fb306738994d6f091791aeb11a5dc87ad8f4c.tar.xz
kernel-qcow2-linux-6a0fb306738994d6f091791aeb11a5dc87ad8f4c.zip
new helper: wait_event_killable_exclusive()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/wait.h')
-rw-r--r--include/linux/wait.h13
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 { \
__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, \