condition_variable
标准库标头<条件[医]变量>
此标头是螺纹支撑图书馆。
班
*。
条件[医]变量%28C++11%29提供了与std::UNIQUE关联的条件变量[医]锁%28级%29
条件[医]变量[医]任何%28C++11%29都提供与任何锁类型%28class%29相关联的条件变量
CV[医]状态%28C++11%29列出了状态变量%28 enum%29上计时等待的可能结果
功能
通知[医]全[医]在[医]螺纹[医]出口%28C++11%29安排呼叫通知[医]当该线程完全完成%28函数%29时,所有这些都将被调用
简介
二次
namespace std {
class condition_variable;
class condition_variable_any;
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk
enum class cv_status {
no_timeout,
timeout
};
}
二次
类std::condition_variable
二次
class condition_variable {
public:
condition_variable(
~condition_variable(
condition_variable(const condition_variable&) = delete;
condition_variable& operator=(const condition_variable&) = delete;
void notify_one() noexcept;
void notify_all() noexcept;
void wait(unique_lock<mutex>& lock
template <class Predicate>
void wait(unique_lock<mutex>& lock, Predicate pred
template <class Clock, class Duration>
cv_status wait_until(unique_lock<mutex>& lock,
const chrono::time_point<Clock, Duration>& abs_time
template <class Clock, class Duration, class Predicate>
bool wait_until(unique_lock<mutex>& lock,
const chrono::time_point<Clock, Duration>& abs_time,
Predicate pred
template <class Rep, class Period>
cv_status wait_for(unique_lock<mutex>& lock,
const chrono::duration<Rep, Period>& rel_time
template <class Rep, class Period, class Predicate>
bool wait_for(unique_lock<mutex>& lock,
const chrono::duration<Rep, Period>& rel_time,
Predicate pred
typedef implementation-defined native_handle_type;
native_handle_type native_handle(
};
二次
类std::condition_variable_any
二次
class condition_variable_any {
public:
condition_variable_any(
~condition_variable_any(
condition_variable_any(const condition_variable_any&) = delete;
condition_variable_any& operator=(const condition_variable_any&) = delete;
void notify_one() noexcept;
void notify_all() noexcept;
template <class Lock>
void wait(Lock& lock
template <class Lock, class Predicate>
void wait(Lock& lock, Predicate pred
template <class Lock, class Clock, class Duration>
cv_status wait_until(Lock& lock,
const chrono::time_point<Clock, Duration>& abs_time
template <class Lock, class Clock, class Duration, class Predicate>
bool wait_until(Lock& lock,
const chrono::time_point<Clock, Duration>& abs_time,
Predicate pred
template <class Lock, class Rep, class Period>
cv_status wait_for(Lock& lock,
const chrono::duration<Rep, Period>& rel_time
template <class Lock, class Rep, class Period, class Predicate>
bool wait_for(Lock& lock,
const chrono::duration<Rep, Period>& rel_time,
Predicate pred
};
二次
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。