![]() |
This is Unofficial EPICS BASE Doxygen Site
|
#include "referenceCountingLock.h"
Public Member Functions | |
POINTER_DEFINITIONS (ReferenceCountingLock) | |
ReferenceCountingLock () | |
virtual | ~ReferenceCountingLock () |
bool | acquire (epics::pvData::int64 msecs) |
void | release () |
int | increment () |
int | decrement () |
Reference counting mutex implementation w/ deadlock detection. Synchronization helper class used (intended for use) for activation/deactivation synchronization. This class enforces attempt
method of acquiring the locks to prevent deadlocks. Class also offers reference counting. (NOTE: automatic lock counting was not implemented due to imperfect usage.)
Definition at line 35 of file referenceCountingLock.h.
epics::pvAccess::ReferenceCountingLock::ReferenceCountingLock | ( | ) |
Constructor of ReferenceCountingLock
. After construction lock is free and reference count equals 1
.
Definition at line 15 of file referenceCountingLock.cpp.
|
virtual |
Destructor of ReferenceCountingLock
.
Definition at line 43 of file referenceCountingLock.cpp.
bool epics::pvAccess::ReferenceCountingLock::acquire | ( | epics::pvData::int64 | msecs | ) |
Attempt to acquire lock.
NOTE: Argument msecs is currently not supported due to Darwin OS not supporting pthread_mutex_timedlock. May be changed in the future.
msecs | the number of milleseconds to wait. An argument less than or equal to zero means not to wait at all. |
true
if acquired, false
otherwise. NOTE: currently this routine always returns true. Look above for explanation. Definition at line 48 of file referenceCountingLock.cpp.
int epics::pvAccess::ReferenceCountingLock::decrement | ( | ) |
Decrement number of references.
Definition at line 92 of file referenceCountingLock.cpp.
int epics::pvAccess::ReferenceCountingLock::increment | ( | ) |
Increment number of references.
Definition at line 85 of file referenceCountingLock.cpp.
epics::pvAccess::ReferenceCountingLock::POINTER_DEFINITIONS | ( | ReferenceCountingLock | ) |
void epics::pvAccess::ReferenceCountingLock::release | ( | ) |
Release previously acquired lock.
Definition at line 73 of file referenceCountingLock.cpp.