PWriteWaitAndSignal Class Reference

#include <syncthrd.h>

List of all members.

Public Member Functions

 PWriteWaitAndSignal (const PReadWriteMutex &rw, PBoolean start=PTrue)
 ~PWriteWaitAndSignal ()

Protected Attributes

PReadWriteMutexmutex


Detailed Description

This class starts a write operation for the PReadWriteMutex on construction and automatically ends the write operation on destruction.

This is very usefull for constructs such as: {verbatim} void func() { PWriteWaitAndSignal mutexWait(myMutex); if (condition) return; do_something(); if (other_condition) return; do_something_else(); } {verbatim}


Constructor & Destructor Documentation

PWriteWaitAndSignal::PWriteWaitAndSignal ( const PReadWriteMutex rw,
PBoolean  start = PTrue 
)

Create the PWriteWaitAndSignal wait instance. This will wait on the specified PReadWriteMutex using the StartWrite()# function before returning.

Parameters:
rw  PReadWriteMutex descendent to wait/signal.
start  Start write operation on PReadWriteMutex before returning.

PWriteWaitAndSignal::~PWriteWaitAndSignal (  ) 

End write operation on the PReadWriteMutex. This will execute the EndWrite() function on the PReadWriteMutex that was used in the construction of this instance.


Member Data Documentation

PReadWriteMutex& PWriteWaitAndSignal::mutex [protected]


The documentation for this class was generated from the following file:
Generated on Mon Sep 15 01:21:39 2008 for PTLib by  doxygen 1.5.1