std::condition_variable_any
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 <condition_variable> | ||
class condition_variable_any; | (seit C++11) | |
Die
condition_variable_any
Klasse ist eine Verallgemeinerung der std::condition_variable. Während std::condition_variable nur auf std::unique_lock<std::mutex> funktioniert, können condition_variable_any
auf einem benutzerdefinierten Sperre, die BasicLockable
Anforderungen zu betreiben .Original:
The
condition_variable_any
class is a generalization of std::condition_variable. Whereas std::condition_variable works only on std::unique_lock<std::mutex>, condition_variable_any
can operate on any user-defined lock that meets the BasicLockable
requirements.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.
condition_variable_any
bietet ähnliche Funktionalität wie std::condition_variable. Es ist ein Synchronisierungsgrundeinheit das verwendet werden kann, um eine bestimmte Anzahl von Threads bis zu blockieren:Original:
condition_variable_any
provides similar functionality to std::condition_variable. It is a synchronization primitive that can be used to block some number of threads until: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.
- eine Benachrichtigung von einem anderen Thread empfangenOriginal:a notification is received from another threadThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - zu einer Zeitüberschreitung oderOriginal:a timeout expires, orThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - ein unechten wakeup auftrittOriginal:a unechten wakeup occursThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Jeder Thread, der auf
std::condition_variable_any
warten möchte, muss sich eine Sperre erst einmal erwerben. Die Wartevorgänge atomar die Sperre sowie die Aussetzung der Ausführung des Threads. Wenn die Bedingung variable benachrichtigt wird, wird der Thread geweckt, und die Sperre wird zurückerworben .Original:
Any thread that intends to wait on
std::condition_variable_any
has to acquire a lock first. The wait operations atomically release the lock and suspend the execution of the thread. When the condition variable is notified, the thread is awakened, and the lock is reacquired.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.
Die Klasse
std::condition_variable_any
ist ein Standard-Layout-Klasse. Es ist nicht copy-konstruierbar, move-konstruierbar, copy-zuweisbare oder verschieben zuweisbare .Original:
The class
std::condition_variable_any
is a standard-layout class. It is not copy-constructible, move-constructible, copy-assignable, or move-assignable.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.
Wenn die Sperre std::unique_lock kann std::condition_variable eine bessere Leistung .
Original:
If the lock is std::unique_lock, std::condition_variable may provide better performance.
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]Member-Funktionen
Baut das Objekt Original: constructs the object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
zerstört sich das Objekt Original: destructs the object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
operator= [gelöscht] | nicht kopieren übertragbar Original: not copy-assignable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |
Original: Notification The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Informiert einen wartenden Thread (öffentliche Elementfunktion) | |
Benachrichtigt alle wartenden Threads (öffentliche Elementfunktion) | |
Original: Waiting The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Blockiert den aktuellen Thread, bis die condition variable geweckt wird Original: blocks the current thread until the condition variable is woken up The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
Blockiert den aktuellen Thread, bis die condition variable geweckt wird oder die angegebenene Zeitspanne abgelaufen ist Original: blocks the current thread until the condition variable is woken up or after the specified timeout duration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
Blockiert den aktuellen Thread, bis die condition variable geweckt wird oder bis der angegebenene Zeitpunkt erreicht wurde Original: blocks the current thread until the condition variable is woken up or until specified time point has been reached The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |