Query: pthread_once
OS: netbsd
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PTHREAD_ONCE(3) BSD Library Functions Manual PTHREAD_ONCE(3)NAMEpthread_once -- dynamic package initializationLIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h> int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)); pthread_once_t once_control = PTHREAD_ONCE_INIT;DESCRIPTIONThe first call to pthread_once() by any thread in a process, with a given once_control, will call the init_routine() with no arguments. Sub- sequent calls to pthread_once() with the same once_control will not call the init_routine(). On return from pthread_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 function pthread_once() is not a cancellation point. However, if init_routine() is a cancellation point and is cancelled, the effect on once_control is as if pthread_once() was never called. The constant PTHREAD_ONCE_INIT initializes the static once synchronization control structure once_control to be used with pthread_once(). The behavior of pthread_once() is undefined if once_control has automatic storage duration or is not initialized by PTHREAD_ONCE_INIT.RETURN VALUESIf successful, the pthread_once() function will return zero. Otherwise an error number will be returned to indicate the error.ERRORSNone.STANDARDSThe function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').BSDJuly 9, 2010 BSD
Related Man Pages |
---|
pthread_once(3) - mojave |
pthread_once(3) - linux |
pthread_once(3c) - sunos |
tis_once(3) - osf1 |
pthread_once(3p) - posix |
Similar Topics in the Unix Linux Community |
---|
Profiling..entry for a function in pthread_create |
valgrind - pthread memory leaks on AIX |
pthread locking and unlocking. U |
pthread locking and unlocking. |
C++ singleton |