summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/lock_state.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2021-09-03 19:11:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-08 07:54:48 +0000
commitc90f38192378c8526354465991830524eda90c1f (patch)
tree73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/db/concurrency/lock_state.cpp
parenta0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff)
downloadmongo-c90f38192378c8526354465991830524eda90c1f.tar.gz
SERVER-59782 migrate makeGuard calls to ScopeGuard
Diffstat (limited to 'src/mongo/db/concurrency/lock_state.cpp')
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp
index eb833039667..e984ef4fffc 100644
--- a/src/mongo/db/concurrency/lock_state.cpp
+++ b/src/mongo/db/concurrency/lock_state.cpp
@@ -367,7 +367,7 @@ bool LockerImpl::_acquireTicket(OperationContext* opCtx, LockMode mode, Date_t d
_clientState.store(reader ? kQueuedReader : kQueuedWriter);
// If the ticket wait is interrupted, restore the state of the client.
- auto restoreStateOnErrorGuard = makeGuard([&] { _clientState.store(kInactive); });
+ ScopeGuard restoreStateOnErrorGuard([&] { _clientState.store(kInactive); });
// Acquiring a ticket is a potentially blocking operation. This must not be called after a
// transaction timestamp has been set, indicating this transaction has created an oplog
@@ -937,7 +937,7 @@ void LockerImpl::_lockComplete(OperationContext* opCtx,
}
// Clean up the state on any failed lock attempts.
- auto unlockOnErrorGuard = makeGuard([&] {
+ ScopeGuard unlockOnErrorGuard([&] {
LockRequestsMap::Iterator it = _requests.find(resId);
invariant(it);
_unlockImpl(&it);
@@ -1037,7 +1037,7 @@ void LockerImpl::getFlowControlTicket(OperationContext* opCtx, LockMode lockMode
// method must not exit with a side-effect on the clientState. That value is also used for
// tracking whether other resources need to be released.
_clientState.store(kQueuedWriter);
- auto restoreState = makeGuard([&] { _clientState.store(kInactive); });
+ ScopeGuard restoreState([&] { _clientState.store(kInactive); });
// Acquiring a ticket is a potentially blocking operation. This must not be called after a
// transaction timestamp has been set, indicating this transaction has created an oplog
// hole.