From 39cb2b8ca7c931496840eafad3c36bc12472e99d Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 9 Jul 2012 16:18:13 -0400 Subject: fix nestable lock reporting --- src/mongo/db/d_concurrency.cpp | 2 +- src/mongo/db/lockstate.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mongo/db/d_concurrency.cpp b/src/mongo/db/d_concurrency.cpp index 9e114c99d40..a580c710893 100644 --- a/src/mongo/db/d_concurrency.cpp +++ b/src/mongo/db/d_concurrency.cpp @@ -202,7 +202,7 @@ namespace mongo { void reportLockStats(BSONObjBuilder& result) { BSONObjBuilder b; b.append(".", qlk.stats.report()); - b.append("admin", nestableLocks[Lock::local]->stats.report()); + b.append("admin", nestableLocks[Lock::admin]->stats.report()); b.append("local", nestableLocks[Lock::local]->stats.report()); { mapsf::ref r(dblocks); diff --git a/src/mongo/db/lockstate.cpp b/src/mongo/db/lockstate.cpp index 0b518df367f..b0ef1f74289 100755 --- a/src/mongo/db/lockstate.cpp +++ b/src/mongo/db/lockstate.cpp @@ -216,14 +216,14 @@ namespace mongo { } LockStat* LockState::getRelevantLockStat() { + if ( _whichNestable ) + return Lock::nestableLockStat( _whichNestable ); + if ( _otherLock ) return &_otherLock->stats; if ( isRW() ) return Lock::globalLockStat(); - - if ( _whichNestable ) - return Lock::nestableLockStat( _whichNestable ); return 0; } -- cgit v1.2.1