Espaços nominais
Variantes
Acções

cnd_timedwait

Da cppreference.com
< c‎ | thread

 
 
Biblioteca de suporte a discussão
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.
Exclusão mútua
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.
Chamar uma 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.
Variáveis ​​de condição
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
Segmento local de armazenamento
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)
Atomicamente bloqueia o mutex apontado por mutex e blocos na condição variável apontada por cond até que o segmento é sinalizado por cnd_signal ou cnd_broadcast, ou até que o ponto de tempo baseada TIME_UTC apontado por time_point foi atingido. 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, 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.
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.

[editar] 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.
duration -
ponteiro para um objeto especificando o tempo de limite de tempo para esperar até
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 se bem sucedido, thrd_timedout se o tempo limite foi alcançado antes do mutex é bloqueado, ou thrd_error se ocorreu um erro.
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] Veja também

blocos em uma variável de condição
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.

(função) [edit]