Skip to content

Commit b57eee5

Browse files
committed
SERVER-34638 Get rid of CollectionLock::relockAsDatabaseExclusive
1 parent b377d97 commit b57eee5

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/mongo/db/concurrency/d_concurrency.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,6 @@ Lock::CollectionLock::~CollectionLock() {
272272
}
273273
}
274274

275-
void Lock::CollectionLock::relockAsDatabaseExclusive(Lock::DBLock& dbLock) {
276-
_lockState->unlock(_id);
277-
278-
dbLock.relockWithMode(MODE_X);
279-
280-
// don't need the lock, but need something to unlock in the destructor
281-
_lockState->lock(_id, MODE_IX);
282-
}
283-
284275
namespace {
285276
stdx::mutex oplogSerialization; // for OplogIntentWriteLock
286277
} // namespace

src/mongo/db/concurrency/d_concurrency.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,6 @@ class Lock {
337337
CollectionLock(CollectionLock&&);
338338
~CollectionLock();
339339

340-
/**
341-
* When holding the collection in MODE_IX or MODE_X, calling this will release the
342-
* collection and database locks, and relocks the database in MODE_X. This is typically
343-
* used if the collection still needs to be created. Upgrading would not be safe as
344-
* it could lead to deadlock, similarly for relocking the database without releasing
345-
* the collection lock. The collection lock will also be reacquired even though it is
346-
* not really needed, as it simplifies invariant checking: the CollectionLock class
347-
* has as invariant that a collection lock is being held.
348-
*/
349-
void relockAsDatabaseExclusive(Lock::DBLock& dbLock);
350-
351340
bool isLocked() const {
352341
return _result == LOCK_OK;
353342
}

0 commit comments

Comments
 (0)