Storage Engine API
mongo::LockMongoFilesShared Class Reference

#include <mmap.h>

Public Member Functions

 LockMongoFilesShared (OperationContext *opCtx)
 

Static Public Member Functions

static void assertExclusivelyLocked (OperationContext *opCtx)
 
static void assertAtLeastReadLocked (OperationContext *opCtx)
 
static unsigned getEra ()
 era changes anytime memory maps come and go. More...
 

Private Attributes

Lock::SharedLock lk
 

Static Private Attributes

static Lock::ResourceMutex mmmutex
 
static unsigned era = 99
 

Friends

class LockMongoFilesExclusive
 

Constructor & Destructor Documentation

◆ LockMongoFilesShared()

mongo::LockMongoFilesShared::LockMongoFilesShared ( OperationContext *  opCtx)
inlineexplicit

Member Function Documentation

◆ assertAtLeastReadLocked()

static void mongo::LockMongoFilesShared::assertAtLeastReadLocked ( OperationContext *  opCtx)
inlinestatic

◆ assertExclusivelyLocked()

static void mongo::LockMongoFilesShared::assertExclusivelyLocked ( OperationContext *  opCtx)
inlinestatic

◆ getEra()

static unsigned mongo::LockMongoFilesShared::getEra ( )
inlinestatic

era changes anytime memory maps come and go.

thus you can use this as a cheap way to check if nothing has changed since the last time you locked. Of course you must be shared locked at the time of this call, otherwise someone could be in progress.

This is used for yielding; see PageFaultException::touch().

Friends And Related Function Documentation

◆ LockMongoFilesExclusive

friend class LockMongoFilesExclusive
friend

Member Data Documentation

◆ era

unsigned mongo::LockMongoFilesShared::era = 99
staticprivate

◆ lk

Lock::SharedLock mongo::LockMongoFilesShared::lk
private

◆ mmmutex

Lock::ResourceMutex mongo::LockMongoFilesShared::mmmutex
staticprivate

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