Namespaces
Variants
Views
Actions

call_once

From cppreference.com
< c‎ | thread
Revision as of 17:43, 31 May 2013 by P12bot (Talk | contribs)

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.

Parameters

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

Return value

(none)