std::recursive_mutex
Aus 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. |
definiert in Header <mutex>
|
||
class recursive_mutex; |
(seit C++11) | |
Die
recursive_mutex
Klasse ist ein Synchronisierungsgrundeinheit, die verwendet werden, um gemeinsame Daten aus gleichzeitig von mehreren Threads zugegriffen schützen können .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
bietet exklusive, rekursive Eigentum Semantik: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.
- Ein aufrufenden Threads' besitzt eine
recursive_mutex
für eine Zeitspanne, die beim Aufrufen erfolgreich entwederlock
odertry_lock
beginnt. Während dieser Zeit kann sich der Faden zusätzliche Anrufelock
odertry_lock
machen. Der Zeitraum des Besitzes endet, wenn der Thread macht eine passende Anzahl von Anrufenunlock
.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. - Wenn ein Thread eine
recursive_mutex
besitzt, werden alle anderen Threads blockieren (für Anrufe inlock
) oder erhalten eine false Rückgabewert (fürtry_lock
), wenn sie das Eigentum an derrecursive_mutex
behaupten versuchen .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. - Die maximale Anzahl, wie oft ein
recursive_mutex
gesperrt werden kann, ist unbegrenzt, aber nach, dass Anzahl erreicht ist, werden Anrufe anlock
wird std::system_error werfen und rufttry_lock
zurückkehren 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.
Das Verhalten eines Programms ist nicht definiert, wenn ein
recursive_mutex
zerstört wird, während noch von einem Thread gehört. Die recursive_mutex
Klasse ist nicht kopierbar .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.
[Bearbeiten] Mitglied Typen
Mitglied Typ
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
native_handle_type
|
Implementierung definiert
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. |
[Bearbeiten] Member-Funktionen
konstruiert den Mutex (öffentliche Elementfunktion) | |
Original: Locking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
sperrt den Mutex, blockiert wenn der Mutex nicht verfügbar ist (öffentliche Elementfunktion) | |
versucht den Mutex zu sperren und kehrt zurück, wenn der Mutex nicht verfügbar ist (öffentliche Elementfunktion) | |
entsperrt den Mutex (öffentliche Elementfunktion) | |
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. | |
gibt das zugrunde liegende implementierungsabhängige Thread-Handle zurück (öffentliche Elementfunktion) |