cnd_timedwait
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'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.
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.
You can help to correct and verify the translation. Click here for instructions.
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. |
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.
You can help to correct and verify the translation. Click here for instructions.
Vedi anche
(C11) |
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) |