|#define||p99_call_once(FLAG, FUNC, ARG)|
|Call a function FUNC exactly once eventually by providing it with argument ARG. |
|expands to a value that can be used to initialize an object of type p99_once_flag |
complete object type that holds a flag for use by p99_call_once
From the wording of the standard it is not clear if a variable of this type must be initialized by means of P99_ONCE_FLAG_INIT. The corresponding POSIX structure requires the analog.
Therefore we don't use the POSIX structure, here, but cook this ourselves with atomic variables. By that we can guarantee that a p99_once_flag that is initialized by the default initializer always has the correct state.