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); }
void Lock::CollectionLock::relockWithMode(LockMode mode, Lock::DBLock& dbLock ) { if (supportsDocLocking() || enableCollectionLocking) { _lockState->unlock(_id); } dbLock.relockWithMode( mode ); if (supportsDocLocking() || enableCollectionLocking) { _lockState->lock(_id, mode); } }
void Lock::CollectionLock::relockAsDatabaseExclusive(Lock::DBLock& dbLock) { if (supportsDocLocking() || enableCollectionLocking) { _lockState->unlock(_id); } dbLock.relockWithMode(MODE_X); if (supportsDocLocking() || enableCollectionLocking) { // don't need the lock, but need something to unlock in the destructor _lockState->lock(_id, MODE_IX); } }