cnd_wait
De cppreference.com
|
|
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>
|
||
int cnd_wait( cnd_t* cond, mtx_t* mutex );
|
(desde C11) | |
Atómicamente bloquea el mutex apuntado por
mutex y los bloques de la variable condición a la que apunta cond hasta que el flujo se indica mediante cnd_signal o cnd_broadcast. 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. 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.
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.
You can help to correct and verify the translation. Click here for instructions.
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. |
Valor de retorno
thrd_success de tener éxito, de lo contrario thrd_error .Original:
thrd_success if successful, thrd_error otherwise.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.
Ver también
(C11) |
bloques en una condición variable, con un tiempo de espera Original: blocks on a condition variable, with a timeout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |