ObjFW
Loading...
Searching...
No Matches
Functions
OFOnce.h File Reference
#include "objfw-defs.h"
import "macros.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.
 

Function Documentation

◆ OFOnce()

void OFOnce ( OFOnceControl * control,
OFOnceFunction function )
extern

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