Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/wait: Add wait_event_state_exclusive()

Allows exclusive waits with a custom @state.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

authored by

Sergey Senozhatsky and committed by
Miklos Szeredi
dd6a5a71 6be0ddb2

+12
+12
include/linux/wait.h
··· 965 965 __ret; \ 966 966 }) 967 967 968 + #define __wait_event_state_exclusive(wq, condition, state) \ 969 + ___wait_event(wq, condition, state, 1, 0, schedule()) 970 + 971 + #define wait_event_state_exclusive(wq, condition, state) \ 972 + ({ \ 973 + int __ret = 0; \ 974 + might_sleep(); \ 975 + if (!(condition)) \ 976 + __ret = __wait_event_state_exclusive(wq, condition, state); \ 977 + __ret; \ 978 + }) 979 + 968 980 #define __wait_event_killable_timeout(wq_head, condition, timeout) \ 969 981 ___wait_event(wq_head, ___wait_cond_timeout(condition), \ 970 982 TASK_KILLABLE, 0, timeout, \