root/Whitix/trunk/include/completion.h

Revision 2010, 510 bytes (checked in by mwhitworth, 3 years ago)

Use new completion data structure, used in async bus scan and URB (USB) code.

Line 
1#ifndef COMPLETION_H
2#define COMPLETION_H
3
4#include <wait.h>
5
6struct Completion
7{
8        unsigned int done;
9        WaitQueue waitQueue;
10};
11
12/* Functions for manipulation completions. */
13
14static inline void CompletionInit(struct Completion* comp)
15{
16        comp->done = 0;
17        INIT_WAITQUEUE_HEAD(&comp->waitQueue);
18}
19
20int CompletionWaitEx(struct Completion* comp, int timeout);
21
22static inline int CompletionWait(struct Completion* comp)
23{
24        return CompletionWaitEx(comp, ~0);
25}
26
27void CompletionDone(struct Completion* comp);
28
29#endif
Note: See TracBrowser for help on using the browser.