Espaços nominais
Variantes
Acções

thread_sleep

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.
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.
 
Definido no cabeçalho <threads.h>
int thrd_sleep(conststruct timespec* time_point,
                struct timespec* remaining );
(desde C11)
Bloqueia a execução da thread atual para pelo menos até o ponto de tempo TIME_UTC baseado apontado por time_point foi atingido.
Original:
Blocks the execution of the current thread for at least until the TIME_UTC based time point pointed to by time_point has been reached.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O sono pode retomar mais cedo, se um sinal que não é ignorada é recebido. Em tal caso, não é se remainingNULL, a duração do tempo remanescente são armazenados no objeto apontado por remaining.
Original:
The sleep may resume earlier if a signal that is not ignored is received. In such case, if remaining is not NULL, the remaining time duration is stored into the object pointed to by remaining.
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

time_point -
ponteiro para o ponto de tempo para dormir até
Original:
pointer to the time point to sleep until
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
remaining -
ponteiro para o objeto para colocar o tempo restante de interrupção. Pode ser NULL, caso em que ele será ignorado
Original:
pointer to the object to put the remaining time on interruption. May be NULL, in which case it is ignored
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

0 no sono bem sucedido, -1 se uma interrupção ocorreu, outro valor negativo se ocorrer um erro.
Original:
0 on successful sleep, -1 if an interrupt occurred, other negative value 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

yields the current time slice
(função)[edit]
close