#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::Lock ( )
inline

Definition at line 28 of file Lock.h.

◆ ~Lock()

virtual Lock::~Lock ( )
inlinevirtual

Definition at line 30 of file Lock.h.

References assert, and count_.

Member Function Documentation

◆ lock()

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().

◆ LockCount()

uint32_t Lock::LockCount ( ) const
inline

Definition at line 53 of file Lock.h.

References count_.

◆ unlock()

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

◆ count_

uint32_t Lock::count_
mutableprivate

Definition at line 56 of file Lock.h.

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


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors