#include <syncthrd.h>
Public Member Functions | |
| PReadWaitAndSignal (const PReadWriteMutex &rw, PBoolean start=PTrue) | |
| ~PReadWaitAndSignal () | |
Protected Attributes | |
| PReadWriteMutex & | mutex |
This is very usefull for constructs such as:
void func()
{
PReadWaitAndSignal mutexWait(myMutex);
if (condition)
return;
do_something();
if (other_condition)
return;
do_something_else();
}
| PReadWaitAndSignal::PReadWaitAndSignal | ( | const PReadWriteMutex & | rw, | |
| PBoolean | start = PTrue | |||
| ) |
Create the PReadWaitAndSignal wait instance. This will wait on the specified PReadWriteMutex using the StartRead() function before returning.
| rw | PReadWriteMutex descendent to wait/signal. |
| start | Start read operation on PReadWriteMutex before returning. |
| PReadWaitAndSignal::~PReadWaitAndSignal | ( | ) |
End read operation on the PReadWriteMutex. This will execute the EndRead() function on the PReadWriteMutex that was used in the construction of this instance.
PReadWriteMutex& PReadWaitAndSignal::mutex [protected] |
1.5.1