source: GPL/trunk/include/linux/completion.h

Last change on this file was 679, checked in by David Azarewicz, 4 years ago

Merge changes from Paul's uniaud32next branch.

File size: 1.3 KB
Line 
1#ifndef _LINUX_COMPLETION_H
2#define _LINUX_COMPLETION_H
3
4#include <linux/wait.h>
5
6/*
7 * struct completion - structure used to maintain state for a "completion"
8 *
9 * This is the opaque structure used to maintain the state for a "completion".
10 * Completions currently use a FIFO to queue threads that have to wait for
11 * the "completion" event.
12 *
13 * See also: complete(), wait_for_completion() (and friends _timeout,
14 * _interruptible, _interruptible_timeout, and _killable), init_completion(),
15 * reinit_completion(), and macros DECLARE_COMPLETION(),
16 * DECLARE_COMPLETION_ONSTACK().
17 */
18struct completion {
19 unsigned int done;
20 wait_queue_head_t wait;
21};
22
23#define DECLARE_COMPLETION_ONSTACK(work) struct completion work;
24/**
25 * init_completion - Initialize a dynamically allocated completion
26 * @x: completion structure that is to be initialized
27 *
28 * This inline function will initialize a dynamically created completion
29 * structure.
30 */
31static inline void init_completion(struct completion *x)
32{
33 x->done = 0;
34 init_waitqueue_head(&x->wait);
35}
36
37extern void complete(struct completion *);
38extern void complete_all(struct completion *);
39extern void wait_for_completion(struct completion *x);
40extern bool try_wait_for_completion(struct completion *x);
41#endif /* _LINUX_COMPLETION_H */
Note: See TracBrowser for help on using the repository browser.