October 2017
Intermediate to advanced
354 pages
9h 28m
English
If any thread needs to wait for a task to complete, it will call wait_for_completion() on the initialized completion structure. If the wait_for_completion operation happens after the call to complete() or complete_all(), the thread simply continues, as the reason it wanted to wait for has been satisfied; else, it waits till complete() is signalled. There are variants available for the wait_for_completion() calls:
extern void wait_for_completion_io(struct completion *); extern int wait_for_completion_interruptible(struct completion *x); extern int wait_for_completion_killable(struct completion *x); extern unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); extern unsigned long wait_for_completion_io_timeout ...