Namespaces
Variants
Views
Actions

call_once

From cppreference.com
< c‎ | thread
Defined in header <threads.h>
void call_once( once_flag* flag, void (*func)(void) );
(since C11)

Calls function func exactly once, even if invoked from several threads.

The completion of the function func synchronizes with all previous or subsequent calls to call_once with the same flag variable.

[edit] Parameters

flag - pointer to an object that is used to ensure func is called only once
func - the function to execute

[edit] Return value

(none)