Storage Engine API
mongo::GlobalLockAcquisitionTracker Class Reference

The GlobalLockAcquisitionTracker keeps track of if the global lock has ever been taken in X or IX mode. More...

#include <global_lock_acquisition_tracker.h>

Detailed Description

The GlobalLockAcquisitionTracker keeps track of if the global lock has ever been taken in X or IX mode.

This class is used to track if we ever did a transaction with the intent to do a write, so that we can enforce write concern on noop writes.

Public Member Functions

 GlobalLockAcquisitionTracker ()=default
 
bool getGlobalExclusiveLockTaken () const
 Returns whether we have ever taken a global lock in X or IX mode in this operation. More...
 
void setGlobalExclusiveLockTaken ()
 Sets that we have ever taken a global lock in X or IX mode in this operation. More...
 

Static Public Attributes

static const OperationContext::Decoration< GlobalLockAcquisitionTrackerget
 

Private Attributes

bool _globalExclusiveLockTaken = false
 

Constructor & Destructor Documentation

◆ GlobalLockAcquisitionTracker()

mongo::GlobalLockAcquisitionTracker::GlobalLockAcquisitionTracker ( )
default

Member Function Documentation

◆ getGlobalExclusiveLockTaken()

bool mongo::GlobalLockAcquisitionTracker::getGlobalExclusiveLockTaken ( ) const

Returns whether we have ever taken a global lock in X or IX mode in this operation.

◆ setGlobalExclusiveLockTaken()

void mongo::GlobalLockAcquisitionTracker::setGlobalExclusiveLockTaken ( )

Sets that we have ever taken a global lock in X or IX mode in this operation.

Member Data Documentation

◆ _globalExclusiveLockTaken

bool mongo::GlobalLockAcquisitionTracker::_globalExclusiveLockTaken = false
private

◆ get

const OperationContext::Decoration< GlobalLockAcquisitionTracker > mongo::GlobalLockAcquisitionTracker::get
static
Initial value:
=
OperationContext::declareDecoration<GlobalLockAcquisitionTracker>()

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