(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / linuxthreads / man / pthread_once.man
blobe9d117b656d0730f7de8f810fb86b0ea6d04d340
1 .TH PTHREAD_ONCE 3 LinuxThreads
3 .SH NAME
4 pthread_once \- once-only initialization
6 .SH SYNOPSIS
7 #include <pthread.h>
9 pthread_once_t once_control = PTHREAD_ONCE_INIT;
11 int pthread_once(pthread_once_t *once_control, void (*init_routine) (void));
13 .SH DESCRIPTION
15 The purpose of !pthread_once! is to ensure that a piece of
16 initialization code is executed at most once. The |once_control|
17 argument points to a static or extern variable statically initialized
18 to !PTHREAD_ONCE_INIT!.
20 The first time !pthread_once! is called with a given |once_control|
21 argument, it calls |init_routine| with no argument and changes the
22 value of the |once_control| variable to record that initialization has
23 been performed. Subsequent calls to !pthread_once! with the same
24 !once_control! argument do nothing. 
26 .SH "RETURN VALUE"
27 !pthread_once! always returns 0.
29 .SH ERRORS
30 None.
32 .SH AUTHOR
33 Xavier Leroy <Xavier.Leroy@inria.fr>