summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/lock_state.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-01-09 17:32:12 -0500
committerBilly Donahue <billy.donahue@mongodb.com>2019-01-11 10:50:23 -0500
commitbbf28648de0d8695c502e13922a8d9e5ca1b51e8 (patch)
tree6382810d03fb698d9b2d49f488be90e604324811 /src/mongo/db/concurrency/lock_state.cpp
parent17514947cc816df2500aa0e919506586d4d56aa0 (diff)
downloadmongo-bbf28648de0d8695c502e13922a8d9e5ca1b51e8.tar.gz
SERVER-30711: scope_guard rewrite, to avoid -Werror=noexcept-type
Macro ON_BLOCK_EXIT(...) now takes a single callable, Some renames: Dismias -> dismiss MakeGuard => makeGuard
Diffstat (limited to 'src/mongo/db/concurrency/lock_state.cpp')
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp
index 8ffbee8c523..11a4028e7fb 100644
--- a/src/mongo/db/concurrency/lock_state.cpp
+++ b/src/mongo/db/concurrency/lock_state.cpp
@@ -335,7 +335,7 @@ LockResult LockerImpl::_acquireTicket(OperationContext* opCtx, LockMode mode, Da
}
// If the ticket wait is interrupted, restore the state of the client.
- auto restoreStateOnErrorGuard = MakeGuard([&] { _clientState.store(kInactive); });
+ auto restoreStateOnErrorGuard = makeGuard([&] { _clientState.store(kInactive); });
OperationContext* interruptible = _uninterruptibleLocksRequested ? nullptr : opCtx;
if (deadline == Date_t::max()) {
@@ -343,7 +343,7 @@ LockResult LockerImpl::_acquireTicket(OperationContext* opCtx, LockMode mode, Da
} else if (!holder->waitForTicketUntil(interruptible, deadline)) {
return LOCK_TIMEOUT;
}
- restoreStateOnErrorGuard.Dismiss();
+ restoreStateOnErrorGuard.dismiss();
}
_clientState.store(reader ? kActiveReader : kActiveWriter);
return LOCK_OK;
@@ -835,7 +835,7 @@ LockResult LockerImpl::lockComplete(OperationContext* opCtx,
uint64_t startOfCurrentWaitTime = startOfTotalWaitTime;
// Clean up the state on any failed lock attempts.
- auto unlockOnErrorGuard = MakeGuard([&] {
+ auto unlockOnErrorGuard = makeGuard([&] {
LockRequestsMap::Iterator it = _requests.find(resId);
_unlockImpl(&it);
});
@@ -892,7 +892,7 @@ LockResult LockerImpl::lockComplete(OperationContext* opCtx,
// lock was still granted after all, but we don't try to take advantage of that and will return
// a timeout.
if (result == LOCK_OK) {
- unlockOnErrorGuard.Dismiss();
+ unlockOnErrorGuard.dismiss();
}
return result;
}