std::unique_lock::try_lock
Aus cppreference.com
< cpp | thread | unique lock
![]() |
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. |
bool try_lock(); |
(seit C++11) | |
Versucht, die zugehörige Mutex, ohne zu blockieren sperren. Effektiv nennt mutex()->try_lock() .
Original:
Tries to lock the associated mutex without blocking. Effectively calls mutex()->try_lock().
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.
std::system_error wird ausgelöst, wenn es keine zugehörige Mutex oder wenn der Mutex bereits gesperrt .
Original:
std::system_error is thrown if there is no associated mutex or if the mutex is already locked.
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.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
(None)
Original:
(none)
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] Rückgabewert
true wenn der Besitz des Mutex erfolgreich erworben, false sonst .
Original:
true if the ownership of the mutex has been acquired successfully, false otherwise.
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] Ausnahmen
- Etwaige Ausnahmen von mutex()->try_lock() geworfenOriginal:Any exceptions thrown by mutex()->try_lock()The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- Wenn es keine zugehörige Mutex std::system_error mit einem Fehlercode std::errc::operation_not_permittedOriginal:If there is no associated mutex, std::system_error with an error code of std::errc::operation_not_permittedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- Wenn der Mutex bereits gesperrt ist, std::system_error mit einem Fehlercode std::errc::resource_deadlock_would_occurOriginal:If the mutex is already locked, std::system_error with an error code of std::errc::resource_deadlock_would_occurThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
This section is incomplete Reason: no example |
[Bearbeiten] Siehe auch
locks the associated mutex (öffentliche Elementfunktion) | |
Versuche, die damit verbundenen TimedLockable Mutex wieder sperren, wenn der Mutex wurde für die angegebene Zeitdauer nicht verfügbarOriginal: attempts to lock the associated TimedLockable mutex, returns if the mutex has been unavailable for the specified time durationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
versucht, die zugehörige TimedLockable Mutex wieder sperren, wenn der Mutex ist nicht verfügbar, bis angegebenen Zeitpunkt erreicht wurde Original: tries to lock the associated TimedLockable mutex, returns if the mutex has been unavailable 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) | |
entriegelt die zugehörige Mutex Original: unlocks the associated mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |