Espaces de noms
Variantes
Affichages
Actions

cnd_timedwait

De cppreference.com
< c‎ | thread

 
 
Bibliothèque de support fil
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.
L'exclusion mutuelle
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.
Appelez fois
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.
Les variables de condition
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
Stockage local des threads
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 );
(depuis C11)
Verrouille atomiquement le mutex pointé par mutex et blocs sur la variable de condition pointé par cond jusqu'à le fil est signalée par cnd_signal ou cnd_broadcast, ou jusqu'à ce que le point de base de temps TIME_UTC pointé par time_point a été atteint. Le mutex est verrouillé à nouveau avant le retour de la fonction .
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.
Le comportement est indéfini si le mutex n'est pas déjà verrouillé par le thread appelant .
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.

[modifier] Paramètres

cond -
pointeur vers la variable de condition pour bloquer le
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 -
pointeur vers le mutex pour débloquer pendant toute la durée du bloc
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 -
pointeur vers un objet en spécifiant délai d'attente à attendre
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.

[modifier] Retourne la valeur

thrd_success en cas de succès, thrd_timedout si le délai d'attente a été atteint avant le mutex est verrouillé, ou thrd_error si une erreur est survenue .
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.

[modifier] Voir aussi

(C11)
blocs sur une variable de condition
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.

(fonction) [edit]