std::condition_variable_any

来自cppreference.com

 
 
线程的支持库
主题
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
thread(C++11)
this_thread命名空间
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.
get_id(C++11)
yield(C++11)
sleep_for(C++11)
sleep_until(C++11)
相互排斥
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.
mutex(C++11)
timed_mutex(C++11)
recursive_mutex(C++11)
recursive_timed_mutex(C++11)
通用锁管理
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.
lock_guard(C++11)
unique_lock(C++11)
defer_lock_t
try_to_lock_t
adopt_lock_t
(C++11)
(C++11)
(C++11)
lock(C++11)
try_lock(C++11)
defer_lock
try_to_lock
adopt_lock
(C++11)
(C++11)
(C++11)
条件变量
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.
condition_variable(C++11)
condition_variable_any(C++11)
notify_all_at_thread_exit(C++11)
cv_status(C++11)
期货
Original:
Futures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
promise(C++11)
future(C++11)
shared_future(C++11)
packaged_task(C++11)
async(C++11)
launch(C++11)
future_status(C++11)
future_error(C++11)
future_category(C++11)
future_errc(C++11)
 
std::condition_variable_any
成员函数
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.
condition_variable_any::condition_variable_any
condition_variable_any::~condition_variable_any
通知
Original:
Notification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
condition_variable_any::notify_one
condition_variable_any::notify_all
等待
Original:
Waiting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
condition_variable_any::wait
condition_variable_any::wait_for
condition_variable_any::wait_until
本机手柄
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.
condition_variable_any::native handle
 
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.
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.
  • 。从另一个线程收到通知。
    Original:
    a notification is received from another thread
    The 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, or
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:
Any thread that intends to wait on std::condition_variable_any has 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 class std::condition_variable_any is 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_lockstd::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 object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数) [edit]
解构的对象
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.

(公共成员函数) [edit]
operator=
[删除] </ SPAN></div></div>
不可复制的转让
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.

(公共成员函数) [edit]
。通知。
Original:
Notification
The 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 thread
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数) [edit]
通知所有等待的线程
Original:
notifies all waiting threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数) [edit]
。 等待。
Original:
Waiting
The 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
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数) [edit]
的条件变量阻塞当前线程,直到被唤醒或在指定的超时时间
Original:
blocks the current thread until the condition variable is woken up or after the specified timeout duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数) [edit]
阻止当前线程,直到条件变量被唤醒,或直至已经达到指定的时间点
Original:
blocks the current thread until the condition variable is woken up or 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.

(公共成员函数) [edit]