summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-10-27 12:22:10 -0400
committerMathias Stearn <mathias@10gen.com>2014-10-27 13:07:15 -0400
commitca29cc4f4f9b7de04dc507c0428da898cbd1c9cd (patch)
tree9e07c012858fe6b74ebe65048b6f6af0e4446cde /src/mongo/db
parent2b8e7ed5681abccd9aa6c53943322979b079dda1 (diff)
downloadmongo-ca29cc4f4f9b7de04dc507c0428da898cbd1c9cd.tar.gz
SERVER-15541 Don't do anything with MMAPV1Flush unless IsForMMAPV1
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp
index 7168b2529a9..a556b853b9c 100644
--- a/src/mongo/db/concurrency/lock_state.cpp
+++ b/src/mongo/db/concurrency/lock_state.cpp
@@ -577,7 +577,9 @@ namespace mongo {
// The global lock must have been acquired just once
stateOut->globalMode = globalRequest->mode;
invariant(unlock(resourceIdGlobal));
- invariant(unlock(resourceIdMMAPV1Flush));
+ if (IsForMMAPV1) {
+ invariant(unlock(resourceIdMMAPV1Flush));
+ }
// Next, the non-global locks.
for (LockRequestsMap::Iterator it = _requests.begin(); !it.finished(); it.next()) {
@@ -608,7 +610,7 @@ namespace mongo {
// We shouldn't be saving and restoring lock state from inside a WriteUnitOfWork.
invariant(!inAWriteUnitOfWork());
- lockGlobal(state.globalMode);
+ lockGlobal(state.globalMode); // also handles MMAPV1Flush
std::vector<LockSnapshot::OneLock>::const_iterator it = state.locks.begin();
for (; it != state.locks.end(); it++) {
@@ -658,6 +660,7 @@ namespace mongo {
template<bool IsForMMAPV1>
void LockerImpl<IsForMMAPV1>::_yieldFlushLockForMMAPV1() {
+ invariant(IsForMMAPV1);
if (!inAWriteUnitOfWork()) {
invariant(unlock(resourceIdMMAPV1Flush));
invariant(LOCK_OK ==