#include <syncthrd.h>
Public Member Functions | |
PWriteWaitAndSignal (const PReadWriteMutex &rw, PBoolean start=true) | |
Create the PWriteWaitAndSignal wait instance. | |
~PWriteWaitAndSignal () | |
End write operation on the PReadWriteMutex. | |
Protected Attributes | |
PReadWriteMutex & | mutex |
This is very useful for constructs such as:
void func()
{
PWriteWaitAndSignal mutexWait(myMutex);
if (condition)
return;
do_something();
if (other_condition)
return;
do_something_else();
}
PWriteWaitAndSignal::PWriteWaitAndSignal | ( | const PReadWriteMutex & | rw, | |
PBoolean | start = true | |||
) |
Create the PWriteWaitAndSignal wait instance.
This will wait on the specified PReadWriteMutex using the StartWrite() function before returning.
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.
PReadWriteMutex& PWriteWaitAndSignal::mutex [protected] |