diff options
author | Geert Bosch <geert@mongodb.com> | 2016-12-08 15:58:23 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2016-12-12 18:09:50 -0500 |
commit | 6dc9fc6ba93b62830dd905f6fac39e0802566a9a (patch) | |
tree | 9f95655578a9e49f70bc4d4ce13d975b0e014d8e /src/mongo/db/concurrency | |
parent | 4ae06d14a14f520f8d16228670ab2e1836173dbc (diff) | |
download | mongo-6dc9fc6ba93b62830dd905f6fac39e0802566a9a.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); } |