EPICS Base  7.0.7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Types | Public Member Functions | List of all members
epicsGuardRelease< T > Class Template Reference

RAII style unlocking of an epicsGuard object. More...

#include <epicsGuard.h>

Public Types

typedef epicsGuard< T > guard_t
 

Public Member Functions

 epicsGuardRelease (epicsGuard< T > &guardIn)
 Constructs an epicsGuardRelease, unlocking the given epicsGuard. More...
 

Detailed Description

template<class T>
class epicsGuardRelease< T >

RAII style unlocking of an epicsGuard object This class can be used while a epicsGuard is active to temporarily release the mutex and automatically re-apply the lock when this object goes out of scope.

This class is also useful in situations where C++ exceptions are possible.

Example

epicsMutex mutex;
{
epicsGuard guard(mutex);
printf("mutex is locked");
{
epicsGuardRelease grelease(guard);
printf("mutex is unlocked");
}
printf("mutex is locked");
}
printf("mutex is unlocked");

Definition at line 30 of file epicsGuard.h.

Constructor & Destructor Documentation

template<class T >
epicsGuardRelease< T >::epicsGuardRelease ( epicsGuard< T > &  guardIn)
inline

Constructs an epicsGuardRelease, unlocking the given epicsGuard for the duration of this object.

Parameters
guardInThe epicsGuard object to be temporarily released.

Definition at line 161 of file epicsGuard.h.


The documentation for this class was generated from the following file: