Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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

This class implement an os-dependant condition. More...

#include <wefts_os_base.h>

Inheritance diagram for Wefts::OSConditionBase:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual void signal ()=0
 Signal a pthread condition.

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 Methods

 OSConditionBase ()
 Intializes pthread condition.


Detailed Description

This class implement an os-dependant condition.

Supposition about OS condition that must be respected by implementations:

See also:
OS Threading Abstraction (and Independence) Layer


Constructor & Destructor Documentation

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

Intializes pthread condition.


Member Function Documentation

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

Signal a pthread condition.

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 Mon Dec 22 04:12:37 2003 for Wefts by doxygen1.2.18