std::recursive_mutex
Da 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. |
Definido no cabeçalho <mutex>
|
||
class recursive_mutex; |
(desde C++11) | |
A classe
recursive_mutex
é um primitivo de sincronização que pode ser usado para proteger os dados compartilhados de ser acessado simultaneamente por vários segmentos.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
ofertas exclusivas, semântica de propriedade recursiva: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.
- Um segmento chamado' possui um
recursive_mutex
por um período de tempo que começa quando ele chama com êxito oulock
outry_lock
. Durante este período, a linha poderá fazer chamadas adicionais paralock
outry_lock
. O período de posse termina quando o segmento faz um número correspondente de chamadas paraunlock
.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. - Quando um segmento possui um
recursive_mutex
, todos os outros segmentos irá bloquear (para chamadas paralock
) ou receber um valor de retorno false (paratry_lock
) se tentarem reivindicar a posse dorecursive_mutex
.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. - O número máximo de vezes que um
recursive_mutex
pode ser bloqueado não é especificado, mas após esse número é atingido, as chamadas paralock
vai jogar std::system_error e chama atry_lock
voltará 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.
O comportamento de um programa é indefinido se um
recursive_mutex
é destruído enquanto ainda pertence por alguma thread. A classe recursive_mutex
não é copiável.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.
[editar] Tipos de membro
Tipo de membro
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
|
Definida pela implementação
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. |
[editar] Funções de membro
constrói o mutex Original: constructs the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
Original: Locking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
bloqueia o mutex, blocos se o mutex não está disponível Original: locks the mutex, blocks 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. (função pública membro) | |
tenta bloquear o mutex, retorna se o mutex não está disponível Original: tries to lock the 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. (função pública membro) | |
destrave o mutex Original: unlocks the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
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. | |
retorna o identificador segmento subjacente definida pela implementação Original: returns the underlying implementation-defined thread handle The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |