# PCondMutex Class Reference

This class defines a thread synchronisation object. More...

`#include <syncthrd.h>`

Inheritance diagram for PCondMutex:

List of all members.

## Public Member Functions

virtual void | WaitCondition ()
| 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.
virtual void | Signal ()
| If there are waiting (blocked) threads then unblock the first one that was blocked.
virtual PBoolean | Condition ()=0
| This is the condition that must be met for the WaitCondition() function to acquire the mutex.
virtual void | OnWait ()
| This function is called immediately before blocking on the condition in the WaitCondition() function.

## 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.

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:

- syncthrd.h