pvAccessCPP 7.1.8
Loading...
Searching...
No Matches
epics::pvAccess::ReferenceCountingLock Class Reference

Reference counting mutex implementation w/ deadlock detection. More...

#include <utils/pv/referenceCountingLock.h>

Public Types

typedef std::tr1::shared_ptr< ReferenceCountingLockshared_pointer
 
typedef std::tr1::shared_ptr< const ReferenceCountingLockconst_shared_pointer
 
typedef std::tr1::weak_ptr< ReferenceCountingLockweak_pointer
 
typedef std::tr1::weak_ptr< const ReferenceCountingLockconst_weak_pointer
 

Public Member Functions

 ReferenceCountingLock ()
 Constructor of ReferenceCountingLock.
 
virtual ~ReferenceCountingLock ()
 Destructor of ReferenceCountingLock.
 
bool acquire (epics::pvData::int64 msecs)
 Attempt to acquire lock.
 
void release ()
 Release previously acquired lock.
 
int increment ()
 Increment number of references.
 
int decrement ()
 Decrement number of references.
 

Detailed Description

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.

Member Typedef Documentation

◆ const_shared_pointer

std::tr1::shared_ptr<const ReferenceCountingLock> epics::pvAccess::ReferenceCountingLock::const_shared_pointer

Definition at line 38 of file referenceCountingLock.h.

◆ const_weak_pointer

std::tr1::weak_ptr<const ReferenceCountingLock> epics::pvAccess::ReferenceCountingLock::const_weak_pointer

Definition at line 38 of file referenceCountingLock.h.

◆ shared_pointer

std::tr1::shared_ptr<ReferenceCountingLock> epics::pvAccess::ReferenceCountingLock::shared_pointer

Definition at line 38 of file referenceCountingLock.h.

◆ weak_pointer

std::tr1::weak_ptr<ReferenceCountingLock> epics::pvAccess::ReferenceCountingLock::weak_pointer

Definition at line 38 of file referenceCountingLock.h.

Constructor & Destructor Documentation

◆ ReferenceCountingLock()

epics::pvAccess::ReferenceCountingLock::ReferenceCountingLock ( )

Constructor of ReferenceCountingLock.

After construction lock is free and reference count equals 1.

Member Function Documentation

◆ acquire()

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.

Parameters
msecsthe number of milleseconds to wait. An argument less than or equal to zero means not to wait at all.
Returns
true if acquired, false otherwise. NOTE: currently this routine always returns true. Look above for explanation.

◆ decrement()

int epics::pvAccess::ReferenceCountingLock::decrement ( )

Decrement number of references.

Returns
number of references.

◆ increment()

int epics::pvAccess::ReferenceCountingLock::increment ( )

Increment number of references.

Returns
number of references.

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