Storage Engine API
mongo::Lock::ResourceMutex Class Reference

For use as general mutex or readers/writers lock, outside the general multi-granularity model. More...

#include <d_concurrency.h>

Detailed Description

For use as general mutex or readers/writers lock, outside the general multi-granularity model.

A ResourceMutex is not affected by yielding/temprelease and two phase locking semantics inside WUOWs. Lock with ResourceLock, SharedLock or ExclusiveLock. Uses same fairness as other LockManager locks.

Public Member Functions

 ResourceMutex (std::string resourceLabel)
 
std::string getName () const
 
bool isExclusivelyLocked (Locker *locker)
 
bool isAtLeastReadLocked (Locker *locker)
 

Static Public Member Functions

static std::string getName (ResourceId resourceId)
 

Private Member Functions

ResourceId rid () const
 Each instantiation of this class allocates a new ResourceId. More...
 

Private Attributes

const ResourceId _rid
 

Friends

class Lock::SharedLock
 
class Lock::ExclusiveLock
 

Constructor & Destructor Documentation

◆ ResourceMutex()

mongo::Lock::ResourceMutex::ResourceMutex ( std::string  resourceLabel)

Member Function Documentation

◆ getName() [1/2]

std::string mongo::Lock::ResourceMutex::getName ( ) const
inline

◆ getName() [2/2]

std::string mongo::Lock::ResourceMutex::getName ( ResourceId  resourceId)
static

◆ isAtLeastReadLocked()

bool mongo::Lock::ResourceMutex::isAtLeastReadLocked ( Locker locker)

◆ isExclusivelyLocked()

bool mongo::Lock::ResourceMutex::isExclusivelyLocked ( Locker locker)

◆ rid()

ResourceId mongo::Lock::ResourceMutex::rid ( ) const
inlineprivate

Each instantiation of this class allocates a new ResourceId.

Friends And Related Function Documentation

◆ Lock::ExclusiveLock

friend class Lock::ExclusiveLock
friend

◆ Lock::SharedLock

friend class Lock::SharedLock
friend

Member Data Documentation

◆ _rid

const ResourceId mongo::Lock::ResourceMutex::_rid
private

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