diff options
author | David Howells <dhowells@redhat.com> | 2019-05-03 18:30:33 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-05-15 17:35:54 +0100 |
commit | a49294eac27c7159cd8b89a96c3b1a857e37b683 (patch) | |
tree | 3627f604ba3767e3383ea01e7aa7399df546a02c /include | |
parent | d0660f0b3b7d1760d1ab60ec8e9d0de52e885207 (diff) | |
download | linux-rpi-a49294eac27c7159cd8b89a96c3b1a857e37b683.tar.gz linux-rpi-a49294eac27c7159cd8b89a96c3b1a857e37b683.tar.bz2 linux-rpi-a49294eac27c7159cd8b89a96c3b1a857e37b683.zip |
Add wait_var_event_interruptible()
Add wait_var_event_interruptible() to allow interruptible waits for events.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/wait_bit.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 2b0072fa5e92..7dec36aecbd9 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h @@ -305,6 +305,19 @@ do { \ __ret; \ }) +#define __wait_var_event_interruptible(var, condition) \ + ___wait_var_event(var, condition, TASK_INTERRUPTIBLE, 0, 0, \ + schedule()) + +#define wait_var_event_interruptible(var, condition) \ +({ \ + int __ret = 0; \ + might_sleep(); \ + if (!(condition)) \ + __ret = __wait_var_event_interruptible(var, condition); \ + __ret; \ +}) + /** * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit * |