[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

PTHREAD_ONCE_INIT Macro

Purpose

Initializes a once synchronization control structure.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>

static pthread_once_t once_block = PTHREAD_ONCE_INIT;

Description

The PTHREAD_ONCE_INIT macro initializes the static once synchronization control structure once_block, used for one-time initializations with the pthread_once (pthread_once Subroutine) subroutine. The once synchronization control structure must be static to ensure the unicity of the initialization.

Note
The pthread.h file header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.

Related Information

The pthread_once (pthread_once Subroutine) subroutine.

One Time Initializations in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]