PTLib
Version 2.18.8
|
This class starts a read operation for the PReadWriteMutex on construction and automatically ends the read operation on destruction. More...
#include <syncthrd.h>
Public Member Functions | |
PReadWaitAndSignal (const PReadWriteMutex &mutex, bool start=true) | |
Create the PReadWaitAndSignal wait instance. More... | |
![]() | |
~PReadWriteWaitAndSignalBase () | |
Additional Inherited Members | |
![]() | |
typedef void(PReadWriteMutex::* | StartFn )(const PDebugLocation *location) |
typedef void(PReadWriteMutex::* | EndFn )(const PDebugLocation *location) |
![]() | |
PReadWriteWaitAndSignalBase (const PReadWriteMutex &mutex, const PDebugLocation *location, StartFn start, EndFn end) | |
![]() | |
PReadWriteMutex & | m_mutex |
PDebugLocation | m_location |
EndFn | m_end |
This class starts a read operation for the PReadWriteMutex on construction and automatically ends the read operation on destruction.
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();
}
|
inline |
Create the PReadWaitAndSignal wait instance.
This will wait on the specified PReadWriteMutex using the StartRead() function before returning.
mutex | PReadWriteMutex descendent to wait/signal. |
start | Start read operation on PReadWriteMutex before returning. |