PCondMutex Class Reference

#include <syncthrd.h>

Inheritance diagram for PCondMutex:

PTimedMutex PSync PObject PIntCondMutex List of all members.

Public Member Functions

virtual void WaitCondition ()
virtual void Signal ()
virtual PBoolean Condition ()=0
virtual void OnWait ()

Protected Attributes

PSyncPoint syncPoint

Detailed Description

This class defines a thread synchronisation object.

This is a special type of mutual exclusion, where a thread wishes to get exlusive use of a resource but only if a certain other condition is met.


Member Function Documentation

virtual PBoolean PCondMutex::Condition (  )  [pure virtual]

This is the condition that must be met for the WaitCondition() function to acquire the mutex.

Implemented in PIntCondMutex.

virtual void PCondMutex::OnWait (  )  [virtual]

This function is called immediately before blocking on the condition in the WaitCondition() function. This could get called multiple times before the condition is met and the WaitCondition() function returns.

virtual void PCondMutex::Signal (  )  [virtual]

If there are waiting (blocked) threads then unblock the first one that was blocked. If no waiting threads and the count is less than the maximum then increment the semaphore.

Implements PSync.

virtual void PCondMutex::WaitCondition (  )  [virtual]

This function attempts to acquire the mutex, but will block not only until the mutex is free, but also that the condition returned by the Condition() function is also met.


Member Data Documentation

PSyncPoint PCondMutex::syncPoint [protected]


The documentation for this class was generated from the following file:
Generated on Thu May 27 01:36:48 2010 for PTLib by  doxygen 1.4.7