NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES
$(NUCLEUS_DIR)/lib/classix/libsys.s.a #include <stdlib.h>int thread_once(thread_once_t *once_control, void (*init_routine)void);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
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 | API RESTRICTIONS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES