![]() |
Storage Engine API
|
There is one of these objects for each resource that has a lock request. More...
There is one of these objects for each resource that has a lock request.
Empty objects (i.e. LockHead with no requests) are allowed to exist on the lock manager's hash table.
The memory and lifetime is controlled entirely by the LockManager class.
Not thread-safe and should only be accessed under the LockManager's bucket lock. Must be locked before locking a partition, not after.
Public Member Functions | |
void | initNew (ResourceId resId) |
Used for initialization of a LockHead, which might have been retrieved from cache and also in order to keep the LockHead structure a POD. More... | |
bool | partitioned () const |
True iff there may be partitions with granted requests for this resource. More... | |
LockRequest * | findRequest (LockerId lockerId) const |
Locates the request corresponding to the particular locker or returns nullptr. More... | |
LockResult | newRequest (LockRequest *request) |
Finish creation of request and put it on the LockHead's conflict or granted queues. More... | |
void | migratePartitionedLockHeads () |
Lock each partitioned LockHead in turn, and move any (granted) intent mode requests for lock->resourceId to lock, which must itself already be locked. More... | |
void | incGrantedModeCount (LockMode mode) |
void | decGrantedModeCount (LockMode mode) |
void | incConflictModeCount (LockMode mode) |
void | decConflictModeCount (LockMode mode) |
Public Attributes | |
ResourceId | resourceId |
LockRequestList | grantedList |
uint32_t | grantedCounts [LockModesCount] |
uint32_t | grantedModes |
LockRequestList | conflictList |
uint32_t | conflictCounts [LockModesCount] |
uint32_t | conflictModes |
std::vector< LockManager::Partition * > | partitions |
uint32_t | conversionsCount |
uint32_t | compatibleFirstCount |
|
inline |
Locates the request corresponding to the particular locker or returns nullptr.
Must be called with the bucket holding this lock head locked.
|
inline |
void mongo::LockHead::migratePartitionedLockHeads | ( | ) |
|
inline |
Finish creation of request and put it on the LockHead's conflict or granted queues.
Returns LOCK_WAITING for conflict case and LOCK_OK otherwise.
|
inline |
True iff there may be partitions with granted requests for this resource.
uint32_t mongo::LockHead::compatibleFirstCount |
uint32_t mongo::LockHead::conflictCounts[LockModesCount] |
LockRequestList mongo::LockHead::conflictList |
uint32_t mongo::LockHead::conflictModes |
uint32_t mongo::LockHead::conversionsCount |
uint32_t mongo::LockHead::grantedCounts[LockModesCount] |
LockRequestList mongo::LockHead::grantedList |
uint32_t mongo::LockHead::grantedModes |
std::vector<LockManager::Partition*> mongo::LockHead::partitions |
ResourceId mongo::LockHead::resourceId |