ObjFW
Functions
OFOnce.h File Reference
#include "objfw-defs.h"
#import "macros.h"
#include <pthread.h>

Go to the source code of this file.

Functions

void OFOnce (OFOnceControl *control, OFOnceFunction function)
 Executes the specified function exactly once in the application's lifetime, even in a multi-threaded environment. More...
 

Function Documentation

◆ OFOnce()

void OFOnce ( OFOnceControl *  control,
OFOnceFunction  function 
)

Executes the specified function exactly once in the application's lifetime, even in a multi-threaded environment.

Parameters
controlAn OFOnceControl. This should be a static variable preinitialized to OFOnceControlInitValue.
functionThe function to execute once