Espacios de nombres
Variantes
Acciones

cnd_timedwait

De cppreference.com
< c‎ | thread

 
 
Tema Biblioteca de ayuda
Threads
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Exclusión mutua
Original:
Mutual exclusion
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Llame a la vez
Original:
Call once
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Las variables de condición
Original:
Condition variables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cnd_wait
cnd_timedwait
cnd_destroy
Almacenamiento local de subprocesos
Original:
Thread-local storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Defined in header <threads.h>
int cnd_timedwait( cnd_t* restrict cond, mtx_t* restrict mutex,
                   const struct timespec* restrict time_point );
(desde C11)
Atómicamente bloquea el mutex apuntado por mutex y bloques en la variable de condición a la que apunta cond hasta que el hilo se señaliza por cnd_signal o cnd_broadcast, o hasta que el punto TIME_UTC basada en el tiempo señalado por time_point se ha alcanzado. La exclusión mutua se bloquea de nuevo antes de que la función regrese .
Original:
Atomically locks the mutex pointed to by mutex and blocks on the condition variable pointed to by cond until the thread is signalled by cnd_signal or cnd_broadcast, or until the TIME_UTC based time point pointed to by time_point has been reached. The mutex is locked again before the function returns.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
El comportamiento no está definido si la exclusión mutua no está bloqueado por el subproceso de llamada .
Original:
The behavior is undefined if the mutex is not already locked by the calling thread.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parámetros

cond -
puntero a la variable de estado para bloquear sucesivamente
Original:
pointer to the condition variable to block on
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mutex -
puntero a la exclusión mutua para desbloquear durante la duración del bloque
Original:
pointer to the mutex to unlock for the duration of the block
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
duration -
puntero a un objeto que especifica el tiempo de desbordamiento que esperar hasta que
Original:
pointer to a object specifying timeout time to wait until
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

thrd_success si tiene éxito, thrd_timedout si el tiempo de espera antes de que se haya alcanzado el mutex está bloqueado, o thrd_error si ocurre un error .
Original:
thrd_success if successful, thrd_timedout if the timeout time has been reached before the mutex is locked, or thrd_error if an error occurred.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ver también

bloques en una variable de condición
Original:
blocks on a condition variable
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [edit]