summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/d_concurrency.cpp
diff options
context:
space:
mode:
authorauto-revert-processor <dev-prod-dag@mongodb.com>2023-05-18 01:59:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-18 02:54:21 +0000
commita741f91c4c09913424751730aabccd594e94ab78 (patch)
tree93a23e52e3a8d077bea2f722912a88a6e270a8dc /src/mongo/db/concurrency/d_concurrency.cpp
parentd7bf13d97da047abfe9098a6b5f98678e89cd987 (diff)
downloadmongo-a741f91c4c09913424751730aabccd594e94ab78.tar.gz
Revert "SERVER-77224 Rename lock_state.h/.cpp to locker_impl.h/.cpp to match the class name"HEADmaster
This reverts commit de55cd2ac227dcc8cae2fd021abc291e86b2abb2.
Diffstat (limited to 'src/mongo/db/concurrency/d_concurrency.cpp')
-rw-r--r--src/mongo/db/concurrency/d_concurrency.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/mongo/db/concurrency/d_concurrency.cpp b/src/mongo/db/concurrency/d_concurrency.cpp
index 9fe447c15f0..fe7daed7201 100644
--- a/src/mongo/db/concurrency/d_concurrency.cpp
+++ b/src/mongo/db/concurrency/d_concurrency.cpp
@@ -29,9 +29,11 @@
#include "mongo/db/concurrency/d_concurrency.h"
+#include <memory>
#include <string>
#include <vector>
+#include "mongo/db/concurrency/flow_control_ticketholder.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
@@ -176,27 +178,6 @@ Lock::GlobalLock::GlobalLock(GlobalLock&& otherLock)
otherLock._result = LOCK_INVALID;
}
-Lock::GlobalLock::~GlobalLock() {
- // Preserve the original lock result which will be overridden by unlock().
- auto lockResult = _result;
- auto* locker = _opCtx->lockState();
-
- if (isLocked()) {
- // Abandon our snapshot if destruction of the GlobalLock object results in actually
- // unlocking the global lock. Recursive locking and the two-phase locking protocol may
- // prevent lock release.
- const bool willReleaseLock = _isOutermostLock && !locker->inAWriteUnitOfWork();
- if (willReleaseLock) {
- _opCtx->recoveryUnit()->abandonSnapshot();
- }
- _unlock();
- }
-
- if (!_skipRSTLLock && (lockResult == LOCK_OK || lockResult == LOCK_WAITING)) {
- locker->unlock(resourceIdReplicationStateTransitionLock);
- }
-}
-
void Lock::GlobalLock::_unlock() {
_opCtx->lockState()->unlockGlobal();
_result = LOCK_INVALID;