#include <wefts_os_base.h>
Inheritance diagram for Wefts::OSConditionBase:
Supposition about OS condition that must be respected by implementations:
Public Member Functions | |
virtual void | signal ()=0 |
Signal a condition variable on ALL waiting threads. | |
virtual void | signalOne ()=0 |
Signal a condition variable on ONE waiting thread. | |
virtual bool | wait (OSMutexBase &mtx, CleanupItem &guard)=0 |
Waiting for a condition (giving off an already held mutex). | |
virtual bool | timedWait (OSMutexBase &mtx, long seconds, long nanoseconds, CleanupItem &guard)=0 |
Timed wait. | |
Protected Member Functions | |
OSConditionBase () | |
Intializes pthread condition. |
|
Intializes pthread condition.
|
|
Signal a condition variable on ALL waiting threads. This correspond roughly to pthread_cond_broadcast. Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows. |
|
Signal a condition variable on ONE waiting thread. This correspond roughly to pthread_cond_signal. Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows. |
|
Timed wait.
Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows. |
|
Waiting for a condition (giving off an already held mutex). The mutex must be held on entrance. Also notice that the guard parameter is passed by value to make a copy of it in the thread stack, so that, after return of the function (and subquesent unlocking of the mutex), another thread can change safely the guard object, and still the cleanup function for this thread will refer to the desired one.
Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows. |