Skip to content

Commit

Permalink
SERVER-52516 redirect LockerImpl to access lock manager through getGl…
Browse files Browse the repository at this point in the history
…obalLockManager()

The globalLockManager will be redefined as a wrapper for debugger scripts.
  • Loading branch information
benety authored and Evergreen Agent committed Jun 9, 2021
1 parent dbe3c74 commit b31b392
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mongo/db/concurrency/lock_state.cpp
Expand Up @@ -537,7 +537,7 @@ void LockerImpl::lock(OperationContext* opCtx, ResourceId resId, LockMode mode,

void LockerImpl::downgrade(ResourceId resId, LockMode newMode) {
LockRequestsMap::Iterator it = _requests.find(resId);
globalLockManager.downgrade(it.objAddr(), newMode);
getGlobalLockManager()->downgrade(it.objAddr(), newMode);
}

bool LockerImpl::unlock(ResourceId resId) {
Expand Down Expand Up @@ -876,8 +876,8 @@ LockResult LockerImpl::_lockBegin(OperationContext* opCtx, ResourceId resId, Loc
// otherwise we might reset state if the lock becomes granted very fast.
_notify.clear();

LockResult result = isNew ? globalLockManager.lock(resId, request, mode)
: globalLockManager.convert(resId, request, mode);
LockResult result = isNew ? getGlobalLockManager()->lock(resId, request, mode)
: getGlobalLockManager()->convert(resId, request, mode);

if (result == LOCK_WAITING) {
globalStats.recordWait(_id, resId, mode);
Expand Down Expand Up @@ -1042,7 +1042,7 @@ void LockerImpl::_releaseTicket() {
}

bool LockerImpl::_unlockImpl(LockRequestsMap::Iterator* it) {
if (globalLockManager.unlock(it->objAddr())) {
if (getGlobalLockManager()->unlock(it->objAddr())) {
if (it->key() == resourceIdGlobal) {
invariant(_modeForTicket != MODE_NONE);

Expand Down

0 comments on commit b31b392

Please sign in to comment.