diff options
author | Geert Bosch <geert@mongodb.com> | 2017-01-31 15:01:20 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-02-02 09:42:38 -0500 |
commit | 6c0ede8c7518d9bb8b5d8ed0897fe26e2b0a94ad (patch) | |
tree | dcc201a776b818e9ddd24778b6497931bcef5f30 /src/mongo/db/concurrency | |
parent | 8b8b867e908837a917313ce033b5cc2a31f1fe99 (diff) | |
download | mongo-6c0ede8c7518d9bb8b5d8ed0897fe26e2b0a94ad.tar.gz |
SERVER-26126 Remove broken lockState caching
Diffstat (limited to 'src/mongo/db/concurrency')
-rw-r--r-- | src/mongo/db/concurrency/lock_state.cpp | 19 | ||||
-rw-r--r-- | src/mongo/db/concurrency/lock_state.h | 2 | ||||
-rw-r--r-- | src/mongo/db/concurrency/locker.h | 7 | ||||
-rw-r--r-- | src/mongo/db/concurrency/locker_noop.h | 4 |
4 files changed, 7 insertions, 25 deletions
diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index 898f9cd462e..9235f56bbb4 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -191,17 +191,6 @@ bool LockerImpl<IsForMMAPV1>::isReadLocked() const { } template <bool IsForMMAPV1> -void LockerImpl<IsForMMAPV1>::assertEmptyAndReset() { - invariant(!inAWriteUnitOfWork()); - invariant(_resourcesToUnlockAtEndOfUnitOfWork.empty()); - invariant(_requests.empty()); - invariant(_modeForTicket == MODE_NONE); - - // Reset the locking statistics so the object can be reused - _stats.reset(); -} - -template <bool IsForMMAPV1> void LockerImpl<IsForMMAPV1>::dump() const { StringBuilder ss; ss << "Locker id " << _id << " status: "; @@ -283,7 +272,13 @@ LockerImpl<IsForMMAPV1>::~LockerImpl() { // Cannot delete the Locker while there are still outstanding requests, because the // LockManager may attempt to access deleted memory. Besides it is probably incorrect // to delete with unaccounted locks anyways. - assertEmptyAndReset(); + invariant(!inAWriteUnitOfWork()); + invariant(_resourcesToUnlockAtEndOfUnitOfWork.empty()); + invariant(_requests.empty()); + invariant(_modeForTicket == MODE_NONE); + + // Reset the locking statistics so the object can be reused + _stats.reset(); } template <bool IsForMMAPV1> diff --git a/src/mongo/db/concurrency/lock_state.h b/src/mongo/db/concurrency/lock_state.h index 79f348d4ac6..e4bdded0bdf 100644 --- a/src/mongo/db/concurrency/lock_state.h +++ b/src/mongo/db/concurrency/lock_state.h @@ -244,8 +244,6 @@ public: virtual bool isWriteLocked() const; virtual bool isReadLocked() const; - virtual void assertEmptyAndReset(); - virtual bool hasLockPending() const { return getWaitingResource().isValid(); } diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h index e00882a498d..6dacd299e65 100644 --- a/src/mongo/db/concurrency/locker.h +++ b/src/mongo/db/concurrency/locker.h @@ -309,13 +309,6 @@ public: virtual bool isReadLocked() const = 0; /** - * Asserts that the Locker is effectively not in use and resets the locking statistics. - * This means, there should be no locks on it, no WUOW, etc, so it would be safe to call - * the destructor or reuse the Locker. - */ - virtual void assertEmptyAndReset() = 0; - - /** * Pending means we are currently trying to get a lock (could be the parallel batch writer * lock). */ diff --git a/src/mongo/db/concurrency/locker_noop.h b/src/mongo/db/concurrency/locker_noop.h index 24450ceeecc..ff252243964 100644 --- a/src/mongo/db/concurrency/locker_noop.h +++ b/src/mongo/db/concurrency/locker_noop.h @@ -160,10 +160,6 @@ public: invariant(false); } - virtual void assertEmptyAndReset() { - invariant(false); - } - virtual bool hasLockPending() const { invariant(false); } |