Namespace
Varianti

cnd_timedwait

Da cppreference.com.
< c‎ | thread

 
 
Discussione libreria di supporto
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.
Mutua esclusione
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.
Chiama una volta
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.
Condizioni variabili
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
Thread-local storage
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 );
(dal C11)
Atomico blocca il mutex puntato da mutex e blocca sulla variabile condizione a cui punta cond fino a quando il filo è segnalato da cnd_signal o cnd_broadcast, o fino al punto di base di tempo TIME_UTC puntato da time_point è stato raggiunto. Il mutex è bloccato di nuovo prima la funzione restituisce.
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.
Il comportamento è indefinito se il mutex non è già bloccato dal thread chiamante.
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.

[modifica] Parametri

cond -
puntatore alla condizione variabile di bloccare
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 -
puntatore al mutex per sbloccare la durata del blocco
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 -
puntatore a un oggetto che specifica il tempo di timeout di aspettare fino a quando
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.

[modifica] Valore di ritorno

thrd_success in caso di successo, thrd_timedout se il tempo di timeout è stato raggiunto prima che il mutex è bloccato, o thrd_error in caso di errore.
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.

[modifica] Vedi anche

blocchi su una variabile di condizione
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.

(funzione) [edit]