MySQL wrapper for a condition variable, using mysql_cond_t as implementation of a condition variable having interface of condition_variable provided by the STL.
More...
#include <condition_variable_wrapper.h>
|
| | Condition_variable_wrapper (PSI_cond_key key) |
| |
| | ~Condition_variable_wrapper () |
| |
| template<class Predicate > |
| void | wait (std::unique_lock< Mutex_wrapper > &lock, Predicate pred) |
| | Wait until notified or predicate is false. More...
|
| |
| template<class Rep , class Period , class Predicate > |
| bool | wait_for (std::unique_lock< Mutex_wrapper > &lock, const std::chrono::duration< Rep, Period > &rel_time, Predicate pred) |
| | Wait for a relative timeout or until notified. More...
|
| |
| template<class Rep , class Period > |
| std::cv_status | wait_for (std::unique_lock< Mutex_wrapper > &lock, const std::chrono::duration< Rep, Period > &rel_time) |
| | Wait for a relative timeout. More...
|
| |
| template<class Clock , class Duration , class Predicate > |
| bool | wait_until (std::unique_lock< Mutex_wrapper > &lock, const std::chrono::time_point< Clock, Duration > &abs_time, Predicate pred) |
| | Wait until an absolute timeout or until notified. More...
|
| |
| template<class Clock , class Duration > |
| std::cv_status | wait_until (std::unique_lock< Mutex_wrapper > &lock, const std::chrono::time_point< Clock, Duration > &abs_time) |
| | Wait until an absolute timeout. More...
|
| |
| void | notify_one () |
| | Notify one waiting thread. More...
|
| |
| void | notify_all () |
| | Notify all waiting threads. More...
|
| |
| void | wait (std::unique_lock< Mutex_wrapper > &lock) |
| | Wait until notified. More...
|
| |
| | Condition_variable_wrapper (const Condition_variable_wrapper &)=delete |
| |
| | Condition_variable_wrapper (Condition_variable_wrapper &&)=delete |
| |
| Condition_variable_wrapper & | operator= (const Condition_variable_wrapper &src)=delete |
| |
| Condition_variable_wrapper & | operator= (Condition_variable_wrapper &&src)=delete |
| |
MySQL wrapper for a condition variable, using mysql_cond_t as implementation of a condition variable having interface of condition_variable provided by the STL.
◆ Condition_variable_wrapper() [1/3]
| mysql::concurrency::Condition_variable_wrapper::Condition_variable_wrapper |
( |
PSI_cond_key |
key | ) |
|
◆ ~Condition_variable_wrapper()
| mysql::concurrency::Condition_variable_wrapper::~Condition_variable_wrapper |
( |
| ) |
|
◆ Condition_variable_wrapper() [2/3]
◆ Condition_variable_wrapper() [3/3]
◆ notify_all()
| void mysql::concurrency::Condition_variable_wrapper::notify_all |
( |
| ) |
|
Notify all waiting threads.
◆ notify_one()
| void mysql::concurrency::Condition_variable_wrapper::notify_one |
( |
| ) |
|
Notify one waiting thread.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ wait() [1/2]
| void mysql::concurrency::Condition_variable_wrapper::wait |
( |
std::unique_lock< Mutex_wrapper > & |
lock | ) |
|
Wait until notified.
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
◆ wait() [2/2]
| void mysql::concurrency::Condition_variable_wrapper::wait |
( |
std::unique_lock< Mutex_wrapper > & |
lock, |
|
|
Predicate |
pred |
|
) |
| |
Wait until notified or predicate is false.
- Template Parameters
-
| Predicate | Type of the predicate function |
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
| [in] | pred | Predicate function to check |
◆ wait_for() [1/2]
template<class Rep , class Period >
| std::cv_status mysql::concurrency::Condition_variable_wrapper::wait_for |
( |
std::unique_lock< Mutex_wrapper > & |
lock, |
|
|
const std::chrono::duration< Rep, Period > & |
rel_time |
|
) |
| |
Wait for a relative timeout.
- Template Parameters
-
| Rep | Representation type of the duration |
| Period | Period type of the duration |
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
| [in] | rel_time | Relative time to wait |
- Returns
- cv_status indicating whether timeout occurred or not
◆ wait_for() [2/2]
template<class Rep , class Period , class
Predicate >
| bool mysql::concurrency::Condition_variable_wrapper::wait_for |
( |
std::unique_lock< Mutex_wrapper > & |
lock, |
|
|
const std::chrono::duration< Rep, Period > & |
rel_time, |
|
|
Predicate |
pred |
|
) |
| |
Wait for a relative timeout or until notified.
- Template Parameters
-
| Rep | Representation type of the duration |
| Period | Period type of the duration |
| Predicate | Type of the predicate function |
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
| [in] | rel_time | Relative time to wait |
| [in] | pred | Predicate function to check |
- Returns
- True if predicate is true, false if timeout occurred
◆ wait_until() [1/2]
template<class Clock , class Duration >
| std::cv_status mysql::concurrency::Condition_variable_wrapper::wait_until |
( |
std::unique_lock< Mutex_wrapper > & |
lock, |
|
|
const std::chrono::time_point< Clock, Duration > & |
abs_time |
|
) |
| |
Wait until an absolute timeout.
- Template Parameters
-
| Clock | Clock type for the time point |
| Duration | Duration type for the time point |
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
| [in] | abs_time | Absolute time to wait until |
- Returns
- cv_status indicating whether timeout occurred or not
◆ wait_until() [2/2]
template<class Clock , class Duration , class
Predicate >
| bool mysql::concurrency::Condition_variable_wrapper::wait_until |
( |
std::unique_lock< Mutex_wrapper > & |
lock, |
|
|
const std::chrono::time_point< Clock, Duration > & |
abs_time, |
|
|
Predicate |
pred |
|
) |
| |
Wait until an absolute timeout or until notified.
- Template Parameters
-
| Clock | Clock type for the time point |
| Duration | Duration type for the time point |
| Predicate | Type of the predicate function |
- Parameters
-
| [in,out] | lock | Unique lock on the mutex to wait on |
| [in] | abs_time | Absolute time to wait until |
| [in] | pred | Predicate function to check |
- Returns
- True if predicate is true, false if timeout occurred
◆ m_cv
| mysql_cond_t mysql::concurrency::Condition_variable_wrapper::m_cv |
|
protected |
The documentation for this class was generated from the following files: