aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/completion.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/completion.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/completion.h')
-rw-r--r--include/linux/completion.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/completion.h b/include/linux/completion.h
new file mode 100644
index 000000000000..90663ad217f9
--- /dev/null
+++ b/include/linux/completion.h
@@ -0,0 +1,42 @@
1#ifndef __LINUX_COMPLETION_H
2#define __LINUX_COMPLETION_H
3
4/*
5 * (C) Copyright 2001 Linus Torvalds
6 *
7 * Atomic wait-for-completion handler data structures.
8 * See kernel/sched.c for details.
9 */
10
11#include <linux/wait.h>
12
13struct completion {
14 unsigned int done;
15 wait_queue_head_t wait;
16};
17
18#define COMPLETION_INITIALIZER(work) \
19 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
20
21#define DECLARE_COMPLETION(work) \
22 struct completion work = COMPLETION_INITIALIZER(work)
23
24static inline void init_completion(struct completion *x)
25{
26 x->done = 0;
27 init_waitqueue_head(&x->wait);
28}
29
30extern void FASTCALL(wait_for_completion(struct completion *));
31extern int FASTCALL(wait_for_completion_interruptible(struct completion *x));
32extern unsigned long FASTCALL(wait_for_completion_timeout(struct completion *x,
33 unsigned long timeout));
34extern unsigned long FASTCALL(wait_for_completion_interruptible_timeout(
35 struct completion *x, unsigned long timeout));
36
37extern void FASTCALL(complete(struct completion *));
38extern void FASTCALL(complete_all(struct completion *));
39
40#define INIT_COMPLETION(x) ((x).done = 0)
41
42#endif