std::unique_lock::try_lock
Da cppreference.com.
< cpp | thread | unique lock
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
bool try_lock(); | (dal C++11) | |
Tenta di bloccare il mutex associato senza bloccare. Chiama efficacemente 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 viene generata se non c'è mutex associato o se il mutex è già bloccato.
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.
Indice |
[modifica]Parametri
(Nessuno)
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.
[modifica]Valore di ritorno
true se la proprietà del mutex è stato acquisito con successo, altrimenti false.
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.
[modifica]Eccezioni
- Eventuali eccezioni generate dal mutex()->try_lock()Original: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.
- Se non vi è associato mutex, std::system_error con un codice di errore di 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.
- Se il mutex è già bloccato, std::system_error con un codice di errore di 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.
[modifica]Esempio
This section is incomplete Reason: no example |
[modifica]Vedi anche
locks the associated mutex (metodo pubblico) | |
i tentativi di bloccare il mutex associato TimedLockable , restituisce se il mutex non è stato disponibile per la durata di tempo specificatoOriginal: 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. (metodo pubblico) | |
cerca di bloccare il mutex associato TimedLockable , restituisce se il mutex è stato disponibile fino al punto di tempo specificato è stato raggiunto 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. (metodo pubblico) | |
sblocca il mutex associato 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. (metodo pubblico) |