Wefts::OSConditionBase Class Reference
[OS Threading Level Abstraction.]

#include <wefts_os_base.h>

Inheritance diagram for Wefts::OSConditionBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class implement an os-dependant condition.

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.


Constructor & Destructor Documentation

Wefts::OSConditionBase::OSConditionBase  )  [inline, protected]
 

Intializes pthread condition.


Member Function Documentation

virtual void Wefts::OSConditionBase::signal  )  [pure virtual]
 

Signal a condition variable on ALL waiting threads.

This correspond roughly to pthread_cond_broadcast.

Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows.

virtual void Wefts::OSConditionBase::signalOne  )  [pure virtual]
 

Signal a condition variable on ONE waiting thread.

This correspond roughly to pthread_cond_signal.

Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows.

virtual bool Wefts::OSConditionBase::timedWait OSMutexBase mtx,
long  seconds,
long  nanoseconds,
CleanupItem guard
[pure virtual]
 

Timed wait.

Parameters:
mtx the mutex to be used with this condition
guard a cleanup item (pair of cleanup object pointer plus integer parameter
seconds count of second
nanoseconds count of nanoseconds
Returns:
true on condition signaled, false on timeout or interrupted wait.

Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows.

virtual bool Wefts::OSConditionBase::wait OSMutexBase mtx,
CleanupItem guard
[pure virtual]
 

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.

Parameters:
mtx the mutex to be used with this condition
guard a cleanup item (pair of cleanup object pointer plus integer parameter
Returns:
true on condition signaled, false on timeout or interrupted wait.

Implemented in Wefts::OSConditionPthread, and Wefts::OSConditionWindows.


The documentation for this class was generated from the following file:
Generated on Tue Oct 5 14:57:02 2004 for Wefts by doxygen 1.3.7