pthread_once(3P)
pthread_once - thread-safe initialization
As shipped in IRIX 6.5.7. Unchanged since IRIX 6.5.
NAME pthread_once - thread-safe initialization C SYNOPSIS #include <pthread.h> int pthread_once(pthread_once_t *once, void (*init)(void)); DESCRIPTION The pthread_once() function ensures that the function init is called exactly once for all callers using the once initialization variable. This variable is initialized with the constant PTHREAD_ONCE_INIT. While init is being executed all callers of pthread_once() will wait. If a thread is cancelled while executing the init function [see pthread_setcancelstate()], then pthread_once() will permit another thread (possibly waiting) to make the call. DIAGNOSTICS There are no errors for pthread_once. SEE ALSO pthread_setcancelstate(3P).