Completion
include/sync/completion.h View source View on GitHubStructs
Section titled “Structs”completion
Section titled “completion”struct completion {
_Atomic uint32_t done;
bool irq_disable;
struct spinlock lock;
struct condvar cv;
}; Functions
Section titled “Functions”completion_init
Section titled “completion_init”void completion_init(struct completion *c, bool irq_disable); completion_reinit
Section titled “completion_reinit”void completion_reinit(struct completion *c); completion_wait
Section titled “completion_wait”void completion_wait(struct completion *c); completion_wait_timeout
Section titled “completion_wait_timeout”bool completion_wait_timeout(struct completion *c, time_ms_t timeout_ms); completion_try_wait
Section titled “completion_try_wait”bool completion_try_wait(struct completion *c); complete
Section titled “complete”void complete(struct completion *c); complete_all
Section titled “complete_all”void complete_all(struct completion *c); completion_done
Section titled “completion_done”bool completion_done(struct completion *c); Macros
Section titled “Macros”COMPLETION_INIT_IRQ_DISABLE
Section titled “COMPLETION_INIT_IRQ_DISABLE”#define COMPLETION_INIT_IRQ_DISABLE true COMPLETION_INIT_NORMAL
Section titled “COMPLETION_INIT_NORMAL”#define COMPLETION_INIT_NORMAL false COMPLETION_INIT
Section titled “COMPLETION_INIT”#define COMPLETION_INIT(irq_dis) \
(struct completion) { \
.done = ATOMIC_VAR_INIT(0), .irq_disable = (irq_dis), \
.lock = SPINLOCK_INIT, \
.cv = { \
.waiters = THREAD_QUEUE_INIT, \
.irq_disable = (irq_dis), \
}, \
}