The pthread_once function

Name

pthread_once -- 

Synopsis

#include <pthread.h>

int pthread_once (pthread_once_t *once_control , void (*init_routine) (void) );

Description

The pthread_once function ensure the function init_routine runs only once regardless of how many threads call it. The thread that makes the first call to pthread_once succeeds in the call. Subsequent calls from other threads fail.

Returns

The pthread_once function returns zero.

Implementation Notes

None