One-time atomic counters
include/sync/once_counter.h View source View on GitHubStructs
Section titled “Structs”once_counter
Section titled “once_counter” struct once_counter (1 field) source
§
atomic_uint64_t count Functions
Section titled “Functions”once_counter_init
Section titled “once_counter_init”void once_counter_init(struct once_counter *c) source once_counter_claim
Section titled “once_counter_claim”bool once_counter_claim(struct once_counter *c) source once_counter_claim_ticket
Section titled “once_counter_claim_ticket”bool once_counter_claim_ticket(
struct once_counter *c,
uint64_t *out_ticket
) source once_counter_count
Section titled “once_counter_count”uint64_t once_counter_count(const struct once_counter *c) source Macros
Section titled “Macros”ONCE_COUNTER_INIT
Section titled “ONCE_COUNTER_INIT”#define ONCE_COUNTER_INIT {.count = ATOMIC_VAR_INIT(0)} source