pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
referenceCountingLock.h
1
7#ifndef REFERENCECOUNTINGLOCK_H
8#define REFERENCECOUNTINGLOCK_H
9
10#ifdef epicsExportSharedSymbols
11# define referenceCountingLockEpicsExportSharedSymbols
12# undef epicsExportSharedSymbols
13#endif
14
15#include <pv/lock.h>
16#include <pv/pvType.h>
17#include <pv/sharedPtr.h>
18
19#ifdef referenceCountingLockEpicsExportSharedSymbols
20# define epicsExportSharedSymbols
21# undef referenceCountingLockEpicsExportSharedSymbols
22#endif
23
24namespace epics {
25namespace pvAccess {
26
36{
37public:
38 POINTER_DEFINITIONS(ReferenceCountingLock);
39
66 void release();
72 int increment();
78 int decrement();
79private:
80 int _references;
81 epics::pvData::Mutex _mutex;
82 epics::pvData::Mutex _countMutex;
83};
84
85}
86}
87
88#endif /* REFERENCECOUNTINGLOCK_H */
Reference counting mutex implementation w/ deadlock detection.
ReferenceCountingLock()
Constructor of ReferenceCountingLock.
bool acquire(epics::pvData::int64 msecs)
Attempt to acquire lock.
virtual ~ReferenceCountingLock()
Destructor of ReferenceCountingLock.
int decrement()
Decrement number of references.
int increment()
Increment number of references.
void release()
Release previously acquired lock.
Copyright - See the COPYRIGHT that is included with this distribution.