EPICS ARCHIVER V4
|
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 () |
Automatically takes and releases an epicsMutex.
Idea follows Jeff Hill's epicsGuard.
|
inline |
Constructor attaches to mutex and locks.
|
inline |
Constructor attaches to mutex and locks.
|
inline |
Destructor unlocks.
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.
|
inline |
void Guard::lock | ( | const char * | file, |
size_t | line | ||
) |
Lock again after a temporary unlock.
|
inline |
Unlock, meant for temporary, manual unlock().