Skip to content

One-time atomic countdown latches

include/sync/once_latch.h View source View on GitHub
struct once_latch (1 field) source
void once_latch_init(struct once_latch *latch, uint64_t count)
source
bool once_latch_count_down(struct once_latch *latch)
source
bool once_latch_is_ready(const struct once_latch *latch)
source
uint64_t once_latch_get_count(const struct once_latch *latch)
source
void once_latch_spin_wait(const struct once_latch *latch)
source
bool once_latch_spin_timeout(
    const struct once_latch *latch,
    time_ms_t timeout_ms
)
source
#define ONCE_LATCH_INIT(n)
source
Expansion
#define ONCE_LATCH_INIT(n) {.count = ATOMIC_VAR_INIT(n)}