call_once
De cppreference.com
(Redirigido desde «c/thread/ONCE FLAG INIT»)
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
| Definido en el archivo de encabezado <threads.h>
|
||
void call_once( once_flag* flag, void (*func)(void) ); |
(desde C11) | |
Las llamadas a funciones
func exactamente una vez, incluso si se invoca desde varios hilos .Original:
Calls function
func exactly once, even if invoked from several threads.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
La finalización de la
func función sincroniza con todas las llamadas anteriores o posteriores a call_once con el mismo flag variable .Original:
The completion of the function
func synchronizes with all previous or subsequent calls to call_once with the same flag variable.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parámetros
| flag | - | puntero a un objeto que se utiliza para asegurar
func se llama sólo una vezOriginal: pointer to an object that is used to ensure func is called only onceThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| func | - | la función a ejecutar
Original: the function to execute The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Valor de retorno
(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.