cnd_wait
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <threads.h>
|
||
int cnd_wait( cnd_t* cond, mtx_t* mutex ); |
(desde C11) | |
Atomicamente bloqueia o mutex apontado por
mutex e bloqueia na variável condição apontada por cond até que o segmento é sinalizado por cnd_signal cnd_broadcast ou. O mutex é novamente bloqueado antes do retorno da função.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.
O comportamento é indefinido se o mutex já não está bloqueada pelo segmento chamado.
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 | - | ponteiro para a condição variável para bloquear em
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 | - | ponteiro para o mutex para desbloquear para a duração do bloco
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 se bem sucedido, caso contrário 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.
Veja também
(C11) |
blocos em uma variável de condição, com um tempo 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. (função) |