Multithreaded Programming Guide

pthread_once Syntax

int  pthread_once(pthread_once_t *once_control, void (*init_routine)(void));
#include <pthread.h>

pthread_once_t once_control = PTHREAD_ONCE_INIT;
int ret;

ret = pthread_once(&once_control, 
init_routine);

The once_control parameter determines whether the associated initialization routine has been called.