summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-04-24 11:45:21 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-04-24 13:50:25 -0400
commitb57eee5a295ede1fd67299dc9990c272c1f66ea3 (patch)
tree8db181e526e584b5e981e852b10457fb9455963a
parentb377d97f8b8e975036595445bd921ec70d42215a (diff)
downloadmongo-r3.7.7.tar.gz
SERVER-34638 Get rid of CollectionLock::relockAsDatabaseExclusiver3.7.7
-rw-r--r--src/mongo/db/concurrency/d_concurrency.cpp9
-rw-r--r--src/mongo/db/concurrency/d_concurrency.h11
2 files changed, 0 insertions, 20 deletions
diff --git a/src/mongo/db/concurrency/d_concurrency.cpp b/src/mongo/db/concurrency/d_concurrency.cpp
index 5e4b051178d..77458fa1882 100644
--- a/src/mongo/db/concurrency/d_concurrency.cpp
+++ b/src/mongo/db/concurrency/d_concurrency.cpp
@@ -272,15 +272,6 @@ Lock::CollectionLock::~CollectionLock() {
}
}
-void Lock::CollectionLock::relockAsDatabaseExclusive(Lock::DBLock& dbLock) {
- _lockState->unlock(_id);
-
- dbLock.relockWithMode(MODE_X);
-
- // don't need the lock, but need something to unlock in the destructor
- _lockState->lock(_id, MODE_IX);
-}
-
namespace {
stdx::mutex oplogSerialization; // for OplogIntentWriteLock
} // namespace
diff --git a/src/mongo/db/concurrency/d_concurrency.h b/src/mongo/db/concurrency/d_concurrency.h
index 469dbb76769..6ec596daf4c 100644
--- a/src/mongo/db/concurrency/d_concurrency.h
+++ b/src/mongo/db/concurrency/d_concurrency.h
@@ -337,17 +337,6 @@ public:
CollectionLock(CollectionLock&&);
~CollectionLock();
- /**
- * When holding the collection in MODE_IX or MODE_X, calling this will release the
- * collection and database locks, and relocks the database in MODE_X. This is typically
- * used if the collection still needs to be created. Upgrading would not be safe as
- * it could lead to deadlock, similarly for relocking the database without releasing
- * the collection lock. The collection lock will also be reacquired even though it is
- * not really needed, as it simplifies invariant checking: the CollectionLock class
- * has as invariant that a collection lock is being held.
- */
- void relockAsDatabaseExclusive(Lock::DBLock& dbLock);
-
bool isLocked() const {
return _result == LOCK_OK;
}