Provides an OOP interface to the Eina_Condition
and automatic resource allocation and deallocation using the RAII programming idiom.
More...
Public Types | |
typedef Eina_Condition * | native_handle_type |
Type for the native Eina_Lock pointer. More... | |
Public Member Functions | |
condition_variable () | |
Create a new condition variable. More... | |
~condition_variable () | |
Release the condition variable resources. More... | |
void | notify_one () |
Unblock a thread waiting for this condition. More... | |
void | notify_all () |
Unblock all threads waiting for this condition. More... | |
template<typename Lock > | |
void | wait (Lock &lock) |
Causes a thread to wait until notified. More... | |
template<typename Lock , typename Predicate > | |
void | wait (Lock &lock, Predicate p) |
Causes a thread to wait until notified. More... | |
native_handle_type | native_handle () |
Get a handle for the wrapped Eina_Condition . More... | |
Provides an OOP interface to the Eina_Condition
and automatic resource allocation and deallocation using the RAII programming idiom.
This class implements condition variables in a way that strongly resembles the STL std::condition_variable
.
typedef Eina_Condition* efl::eina::condition_variable::native_handle_type |
Type for the native Eina_Lock pointer.
|
inline |
Create a new condition variable.
Automatically allocates a new condition variable and does any platform dependent initialization that is required.
References eina_condition_new().
|
inline |
Release the condition variable resources.
Automatically deallocates the condition variable and does any platform dependent cleanup that is required.
References eina_condition_free().
|
inline |
Unblock a thread waiting for this condition.
<tt>eina::system_error</tt> | on fail. |
This member function unblock a thread waiting on this condition variable. If there is more than one thread waiting on this condition, one of them will be unblocked, but which one is undefined. If you do not know for sure that there is only one thread waiting, use notify_all() instead.
References eina_condition_signal().
|
inline |
Unblock all threads waiting for this condition.
<tt>eina::system_error</tt> | on fail. |
This member function unblocks all the threads waiting on the this condition. If you know for sure that there is only one thread waiting, use notify_one instead to gain a little optimization.
References eina_condition_broadcast().
|
inline |
Causes a thread to wait until notified.
lock | A lockable object (mutex , unique_lock , etc) that is currently locked by this thread. All concurrent calls to wait member functions of this object shall use the same lockable object. |
This member function makes a thread block until notified.
References eina_condition_wait().
|
inline |
Causes a thread to wait until notified.
lock | A lockable object (mutex , unique_lock , etc) that is currently locked by this thread. All concurrent calls to wait member functions of this object shall use the same lockable object. |
p | A callable object or function that takes no arguments and returns a value that can be evaluated as a bool. This is called repeatedly until it evaluates to true. |
This member function only blocks the thread if p
is evaluated to false
. In this case the thread remains blocked until notified and the result of p
evaluates to true
.
|
inline |
Get a handle for the wrapped Eina_Condition
.
Eina_Condition
.This member function returns the native Eina_Condition
handle that is wrapped inside this object.