Espacios de nombres
Variantes
Acciones

std::unique_lock::try_lock_for

De cppreference.com
< cpp‎ | thread‎ | unique lock

 
 
Tema Biblioteca de ayuda
Threads
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
this_thread espacio de nombres
Original:
this_thread namespace
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
Exclusión mutua
Original:
Mutual exclusion
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Gestión de bloqueos genérico
Original:
Generic lock management
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Las variables de condición
Original:
Condition variables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Futuros
Original:
Futures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
(C++11)
 
std::unique_lock
Las funciones miembro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Bloqueo
Original:
Locking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unique_lock::try_lock_for
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los observadores
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
template< class Rep, class Period >
bool try_lock_for( const std::chrono::duration<Rep,Period>& timeout_duration );
(desde C++11)
Intenta bloquear el mutex asociado. Bloquea hasta timeout_duration especificado ha transcurrido o el bloqueo adquirido, lo que ocurra primero. En la adquisición exitosa de bloqueo vuelve true lo contrario, devuelve false. Puede bloquear por más de timeout_duration .
Original:
Tries to lock the associated mutex. Blocks until specified timeout_duration has elapsed or the lock is acquired, whichever comes first. On successful lock acquisition returns true, otherwise returns false. May block for longer than timeout_duration.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Efectivamente llama mutex()->try_lock_for(timeout_duration)
Original:
Effectively calls mutex()->try_lock_for(timeout_duration)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::system_error se produce si no hay mutex asociada o si el mutex está bloqueado ya .
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.

Contenido

[editar] Parámetros

timeout_duration -
duración máxima de bloquear para
Original:
maximum duration to block for
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

true si la propiedad de la exclusión mutua se ha adquirido con éxito, de lo contrario 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.

[editar] Excepciones

  • Cualquier excepción lanzada por mutex()->try_lock_for(timeout_duration)
    Original:
    Any exceptions thrown by mutex()->try_lock_for(timeout_duration)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

[editar] Ver también

locks the associated mutex
(función miembro público) [editar]
intenta bloquear el mutex asociado, devoluciones si el mutex no está disponible
Original:
tries to lock the associated 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.

(función miembro público) [editar]
intenta bloquear el mutex asociado TimedLockable, devoluciones si el mutex no ha estado disponible hasta que se especifique punto de tiempo se ha alcanzado
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.

(función miembro público) [editar]
desbloquea el mutex asociado
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.

(función miembro público) [editar]