#include <Lock.h>

Collaboration diagram for Lock:

Public Member Functions

 Lock ()
 
virtual ~Lock ()
 
void lock () const
 
uint32_t unlock () const
 
uint32_t LockCount () const
 Inspect the current count of references. More...
 

Private Attributes

uint32_t count_
 number of references currently being tracked More...
 

Detailed Description

This class provides a tracking counter and presents lock(), unlock() and LockCount() accessors.

All locks must be cleared with unlock() before this object is destroyed.

Accessors provided by this interface are not private, to allow class hierarchies.

Build with -DLOCKCOUNT_DEBUG flag to enable lock debugging. It is disabled by default due to the cost of debug output.

Definition at line 25 of file Lock.h.

Constructor & Destructor Documentation

Lock::Lock ( )
inline

Definition at line 28 of file Lock.h.

virtual Lock::~Lock ( )
inlinevirtual

Definition at line 30 of file Lock.h.

References assert, and count_.

Member Function Documentation

void Lock::lock ( ) const
inline

Register one lock / reference against this object. All locks must be cleared before it may be destroyed.

Definition at line 34 of file Lock.h.

References assert, count_, debugs, and UINT32_MAX.

Referenced by DiskdIOStrategy::send().

uint32_t Lock::LockCount ( ) const
inline

Definition at line 53 of file Lock.h.

References count_.

uint32_t Lock::unlock ( ) const
inline

Clear one lock / reference against this object. All locks must be cleared before it may be destroyed.

Definition at line 44 of file Lock.h.

References assert, count_, and debugs.

Member Data Documentation

uint32_t Lock::count_
mutableprivate

Definition at line 56 of file Lock.h.

Referenced by lock(), LockCount(), unlock(), and ~Lock().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors