std::condition_variable
Da cppreference.com.
![]() |
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. |
Elemento definito nell'header <condition_variable>
|
||
class condition_variable; |
(dal C++11) | |
La classe condition_variable
è una primitiva di sincronizzazione che può essere utilizzata per bloccare un thread, o più thread contemporaneamente, fino a che:
- viene ricevuta una notifica da un altro thread
- scade un timeout
- si verifica una wakeup spuria
Qualsiasi thread che intende aspettare
std::condition_variable
deve acquisire una std::unique_lock prima. Le operazioni di attesa atomicamente rilasciare il mutex e sospendere l'esecuzione del thread. Quando la variabile di condizione è notificato, il filo si risveglia, e il mutex viene riacquisito.Original:
Any thread that intends to wait on
std::condition_variable
has to acquire a std::unique_lock first. The wait operations atomically release the mutex and suspend the execution of the thread. When the condition variable is notified, the thread is awakened, and the mutex 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.
La classe è un
std::condition_variable
StandardLayoutType
. Non è CopyConstructible
, MoveConstructible
, CopyAssignable
, MoveAssignable
.Original:
The class
std::condition_variable
is a StandardLayoutType
. It is not CopyConstructible
, MoveConstructible
, CopyAssignable
, MoveAssignable
.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] Membri tipi
Membro tipo
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
|
Implementazione definita
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. |
[modifica] Membri funzioni
Costruisce l'oggetto 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. (metodo pubblico) | |
distrugge l'oggetto 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. (metodo pubblico) | |
operator= [cancellato] |
non copia-assegnabile 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. (metodo pubblico) |
Original: Notification The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
segnala un thread in attesa Original: notifies one waiting thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click |