October 2017
Intermediate to advanced
354 pages
9h 28m
English
The following macro can be used for static declaration and initialization of a completion structure:
#define DECLARE_COMPLETION(work) \ struct completion work = COMPLETION_INITIALIZER(work)
The following inline function will initialize a dynamically created completion structure:
static inline void init_completion(struct completion *x) { x->done = 0; init_waitqueue_head(&x->wait); }
The following inline function will be used to reinitialize a completion structure if you need to reuse it. This can be used after complete_all():
static inline void reinit_completion(struct completion *x) { x->done = 0; }