class PWriteWaitAndSignal

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

Public Methods

[more] PWriteWaitAndSignal ( const PReadWriteMutex & rw, BOOL start = TRUE )
Create the PWriteWaitAndSignal wait instance.
[more] ~PWriteWaitAndSignal ()
End write operation on the PReadWriteMutex.


Documentation

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:

    void func()
    {
      PWriteWaitAndSignal mutexWait(myMutex);
      if (condition)
        return;
      do_something();
      if (other_condition)
        return;
      do_something_else();
    }
o PWriteWaitAndSignal( const PReadWriteMutex & rw, BOOL start = TRUE )
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.

o ~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.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.