NAME | SYNOPSIS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES
#include <stdlib.h>int thread_once(thread_once_t *once_control, void (*init_routine)void);
The first call to thread_once by any thread in an actor, with a given once_control, will call the init_routine with no arguments. Subsequent calls to thread_once with the same once_control will not call the init_routine. On return from thread_once, it is guaranteed that init_routine has completed. The once_control parameter is used to determine whether the associated initialization routine has been called.
The behaviour of thread_once is undefined if once_control has an automatic storage duration or is not initialized by zero.
Upon completion, thread_once returns zero.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES