std::condition_variable_any
来自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. |
| Defined in header <condition_variable>
|
||
| class condition_variable_any; |
(C++11 起) | |
。
condition_variable_any类是一个概括的std::condition_variable。而std::condition_variable只适用于std::unique_lock<std::mutex>,condition_variable_any可以运行在任何用户定义的锁,以满足BasicLockable要求.Original:
The
condition_variable_any class is a generalization of std::condition_variable. Whereas std::condition_variable works only on std::unique_lock<std::mutex>, condition_variable_any can operate on any user-defined lock that meets the BasicLockable requirements.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.
。
condition_variable_any提供了类似的功能,std::condition_variable。它是一个可以用来阻止某些的线程数,直到同步原语:。Original:
condition_variable_any provides similar functionality to std::condition_variable. It is a synchronization primitive that can be used to block some number of threads until: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.
- 。从另一个线程收到通知。Original:a notification is received from another threadThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 。 一个超时过期或者。Original:a timeout expires, orThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.- 。 。虚假唤醒。发生。Original:a 。虚假唤醒。 occursThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
。任何线程等待std::condition_variable_any,首先获得一个锁。等待原子操作解除锁定,暂停线程的执行。条件变量的通知时,该线程被唤醒,重新获取锁.Original:Any thread that intends to wait onstd::condition_variable_anyhas to acquire a lock first. The wait operations atomically release the lock and suspend the execution of the thread. When the condition variable is notified, the thread is awakened, and the lock is reacquired.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.。类std::condition_variable_any是一个标准布局类。这不是拷贝构造,构造的,移动,复制分配,或移动分配的。Original:The classstd::condition_variable_anyis a standard-layout class. It is not copy-constructible, move-constructible, copy-assignable, or move-assignable.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.。如果锁std::unique_lock,std::condition_variable可能会提供更好的性能.Original:If the lock is std::unique_lock, std::condition_variable may provide better performance.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.[编辑] 。成员函数。
构造对象Original:constructs the objectThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)解构的对象Original:destructs the objectThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)operator=[删除] </ SPAN></div></div>不可复制的转让Original:not copy-assignableThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)。通知。Original:NotificationThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.通知一个正在等待的线程Original:notifies one waiting threadThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)通知所有等待的线程Original:notifies all waiting threadsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)。 等待。Original:WaitingThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.的条件变量阻塞当前线程,直到被唤醒Original:blocks the current thread until the condition variable is woken upThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)的条件变量阻塞当前线程,直到被唤醒或在指定的超时时间Original:blocks the current thread until the condition variable is woken up or after the specified timeout durationThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数)阻止当前线程,直到条件变量被唤醒,或直至已经达到指定的时间点Original:blocks the current thread until the condition variable is woken up or until specified time point has been reachedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成员函数) -