#include <syncthrd.h>
Inheritance diagram for PCondMutex:
Public Member Functions | |
virtual void | WaitCondition () |
virtual void | Signal () |
virtual PBoolean | Condition ()=0 |
virtual void | OnWait () |
Protected Attributes | |
PSyncPoint | syncPoint |
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.
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.
PSyncPoint PCondMutex::syncPoint [protected] |