std::recursive_mutex
De cppreference.com
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <mutex> | ||
class recursive_mutex; | (depuis C++11) | |
La classe
recursive_mutex
est une primitive de synchronisation qui peut être utilisé pour protéger des données partagées soit simultanément par plusieurs threads .Original:
The
recursive_mutex
class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads.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.
recursive_mutex
offres exclusives, la sémantique de propriété récursives:Original:
recursive_mutex
offers exclusive, recursive ownership semantics: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.
- Un thread appelant' possède une
recursive_mutex
pendant une période de temps qui commence lors de l'appel avec succès ou l'autre oulock
try_lock
. Pendant cette période, le fil peut passer des appels supplémentaires pourlock
outry_lock
. La durée de détention prend fin lorsque le thread effectue un nombre correspondant d'appels àunlock
.Original:A calling thread owns arecursive_mutex
for a period of time that starts when it successfully calls eitherlock
ortry_lock
. During this period, the thread may make additional calls tolock
ortry_lock
. The period of ownership ends when the thread makes a matching number of calls tounlock
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Quand un thread possède un
recursive_mutex
, tous les autres threads va bloquer (pour les appels verslock
) ou de recevoir une valeur de retour false (pourtry_lock
) s'ils tentent de revendiquer la propriété de larecursive_mutex
.Original:When a thread owns arecursive_mutex
, all other threads will block (for calls tolock
) or receive a false return value (fortry_lock
) if they attempt to claim ownership of therecursive_mutex
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Le nombre maximum de fois qu'un
recursive_mutex
peuvent être verrouillés n'est pas spécifié, mais après ce nombre est atteint, les appels àlock
jettera std::system_error et appelle àtry_lock
reviendra false .Original:The maximum number of times that arecursive_mutex
may be locked is unspecified, but after that number is reached, calls tolock
will throw std::system_error and calls totry_lock
will return false.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Le comportement d'un programme n'est pas défini si un
recursive_mutex
est détruite alors toujours détenu par un autre thread. La classe recursive_mutex
est non copiable .Original:
The behavior of a program is undefined if a
recursive_mutex
is destroyed while still owned by some thread. The recursive_mutex
class is non-copyable.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.
[modifier]Types de membres
Type du membre | Définition |
native_handle_type | ' Définie par l'implémentation Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier]Fonctions membres
construit le mutex Original: constructs the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
Original: Locking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
verrouille le mutex, bloque si le mutex n'est pas disponible (fonction membre publique) | |
essaie de verrouiller le mutex, retourne si le mutex n'est pas disponible Original: tries to lock the mutex, returns if the mutex is not available The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
déverrouille le mutex Original: unlocks the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
Original: Native handle The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
retourne le handle de thread sous-jacente définie par l'implémentation Original: returns the underlying implementation-defined thread handle The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) |