EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | List of all members
Guard Class Reference

Automatically takes and releases an epicsMutex. More...

#include <Guard.h>

Public Member Functions

 Guard (const char *file, size_t line, Guardable &guardable)
 Constructor attaches to mutex and locks. More...
 
 Guard (const char *file, size_t line, OrderedMutex &mutex)
 Constructor attaches to mutex and locks. More...
 
 ~Guard ()
 Destructor unlocks. More...
 
void check (const char *file, size_t line, const OrderedMutex &the_one_it_should_be)
 Check if the guard is assigned to the correct mutex. More...
 
void unlock ()
 Unlock, meant for temporary, manual unlock(). More...
 
void lock (const char *file, size_t line)
 Lock again after a temporary unlock. More...
 
bool isLocked ()
 

Detailed Description

Automatically takes and releases an epicsMutex.

Idea follows Jeff Hill's epicsGuard.

Constructor & Destructor Documentation

Guard::Guard ( const char *  file,
size_t  line,
Guardable guardable 
)
inline

Constructor attaches to mutex and locks.

Guard::Guard ( const char *  file,
size_t  line,
OrderedMutex mutex 
)
inline

Constructor attaches to mutex and locks.

Guard::~Guard ( )
inline

Destructor unlocks.

Member Function Documentation

void Guard::check ( const char *  file,
size_t  line,
const OrderedMutex the_one_it_should_be 
)

Check if the guard is assigned to the correct mutex.

Uses ABORT_ON_ERRORS environment variable.

bool Guard::isLocked ( )
inline
Returns
Returns the current lock state.
void Guard::lock ( const char *  file,
size_t  line 
)

Lock again after a temporary unlock.

void Guard::unlock ( )
inline

Unlock, meant for temporary, manual unlock().


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