|
NAMEpthread_once —
dynamic package initialization
LIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h>
pthread_once_t once_control =
PTHREAD_ONCE_INIT;
DESCRIPTIONThe first call topthread_once () by any thread in a
process, with a given once_control, will call the
init_routine () with no arguments. Subsequent 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 The constant PTHREAD_ONCE_INIT is defined by
header The behavior of RETURN VALUESIf successful, thepthread_once () function will return
zero. Otherwise an error number will be returned to indicate the error.
ERRORSNone.STANDARDSThepthread_once () function conforms to
ISO/IEC 9945-1:1996 (“POSIX.1”).
Visit the GSP FreeBSD Man Page Interface. |