P99

◆ P99_INIT_CHAIN

#define P99_INIT_CHAIN (   T)    p99_call_once(&P99_PASTE3(p99_, T, _once), P99_PASTE3(p99_, T, _once).p00_init)

Ensure that the function that was defined with P99_DEFINE_ONCE_CHAIN has been called exactly once before proceeding.

Such a call could be placed at the beginning of a user function to ensure that a shared resource is always initialized before its use. A better strategy though would be to call P99_INIT_CHAIN from main, e.g., before any threads of the application are started, or through the mechanism provided by :::P99_INIT_FUNCTION.

See also
P99_DECLARE_ONCE_CHAIN
P99_DEFINE_ONCE_CHAIN

Definition at line 291 of file p99_threads.h.