History

sched: add kernel doc for the completion, fix kernel-doc-nano-HOWTO.txt

This patch adds kernel doc for the completion feature. An error in the split-man.pl PERL snippet in kernel-doc-nano-HOWTO.txt is also fixed.

Kevin Diggs committed 18 years ago

Commit 65eb3dc1 parent 3cf430b3 files · +99 −2Browse files

Showing the changes to include/linux/completion.h (1 of 3 files). Show all

Unified · Split

include/linux/completion.h+41−0
@@ -10,6 +10,18 @@ · 9 unmodified lines
1010
1111 #include <linux/wait.h>
1212
13+/**
14+ * struct completion - structure used to maintain state for a "completion"
15+ *
16+ * This is the opaque structure used to maintain the state for a "completion".
17+ * Completions currently use a FIFO to queue threads that have to wait for
18+ * the "completion" event.
19+ *
20+ * See also: complete(), wait_for_completion() (and friends _timeout,
21+ * _interruptible, _interruptible_timeout, and _killable), init_completion(),
22+ * and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and
23+ * INIT_COMPLETION().
24+ */
1325 struct completion {
1426 unsigned int done;
1527 wait_queue_head_t wait;
@@ -21,6 +33,14 @@ struct completion { · 5 unmodified lines
2133 #define COMPLETION_INITIALIZER_ONSTACK(work) \
2234 ({ init_completion(&work); work; })
2335
36+/**
37+ * DECLARE_COMPLETION: - declare and initialize a completion structure
38+ * @work: identifier for the completion structure
39+ *
40+ * This macro declares and initializes a completion structure. Generally used
41+ * for static declarations. You should use the _ONSTACK variant for automatic
42+ * variables.
43+ */
2444 #define DECLARE_COMPLETION(work) \
2545 struct completion work = COMPLETION_INITIALIZER(work)
2646
@@ -29,6 +49,13 @@ struct completion { · 2 unmodified lines
2949 * completions - so we use the _ONSTACK() variant for those that
3050 * are on the kernel stack:
3151 */
52+/**
53+ * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure
54+ * @work: identifier for the completion structure
55+ *
56+ * This macro declares and initializes a completion structure on the kernel
57+ * stack.
58+ */
3259 #ifdef CONFIG_LOCKDEP
3360 # define DECLARE_COMPLETION_ONSTACK(work) \
3461 struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
@@ -36,6 +63,13 @@ struct completion { · 1 unmodified line
3663 # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
3764 #endif
3865
66+/**
67+ * init_completion: - Initialize a dynamically allocated completion
68+ * @x: completion structure that is to be initialized
69+ *
70+ * This inline function will initialize a dynamically created completion
71+ * structure.
72+ */
3973 static inline void init_completion(struct completion *x)
4074 {
4175 x->done = 0;
@@ -55,6 +89,13 @@ extern bool completion_done(struct completion *x); · 13 unmodified lines
5589 extern void complete(struct completion *);
5690 extern void complete_all(struct completion *);
5791
92+/**
93+ * INIT_COMPLETION: - reinitialize a completion structure
94+ * @x: completion structure to be reinitialized
95+ *
96+ * This macro should be used to reinitialize a completion structure so it can
97+ * be reused. This is especially important after complete_all() is used.
98+ */
5899 #define INIT_COMPLETION(x) ((x).done = 0)
59100
60101