Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a49294ea authored by David Howells's avatar David Howells
Browse files

Add wait_var_event_interruptible()



Add wait_var_event_interruptible() to allow interruptible waits for events.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent d0660f0b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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
 *