1 #ifndef __LINUX_COMPLETION_H
2 #define __LINUX_COMPLETION_H
5 * (C) Copyright 2001 Linus Torvalds
7 * Atomic wait-for-completion handler data structures.
8 * See kernel/sched/completion.c for details.
11 #include <linux/wait.h>
15 wait_queue_head_t wait;
18 #define DECLARE_COMPLETION(work) \
19 struct completion work = { \
21 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) \
24 #define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
26 static inline void init_completion(struct completion *x)
29 init_waitqueue_head(&x->wait);
32 static inline void reinit_completion(struct completion *x)
37 void complete(struct completion *);
38 void wait_for_completion(struct completion *);
40 #define wait_for_completion_interruptible(x) (wait_for_completion(x), 0)