summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/lock_manager.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-02-27 16:05:25 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-03-02 17:27:52 -0500
commit197cdebe7de9be23906c175b31f056c0351e9eb3 (patch)
treed135a3945c3c522e904b8c68c2a92211cce9a3d2 /src/mongo/db/concurrency/lock_manager.cpp
parentdaf6c05ab22010bb74019189dd4bc4b4347aceb5 (diff)
downloadmongo-197cdebe7de9be23906c175b31f056c0351e9eb3.tar.gz
SERVER-17416 MMAP V1 journal thread should check for deadlocks
Also improve the reporting of the Locker::dump function.
Diffstat (limited to 'src/mongo/db/concurrency/lock_manager.cpp')
-rw-r--r--src/mongo/db/concurrency/lock_manager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mongo/db/concurrency/lock_manager.cpp b/src/mongo/db/concurrency/lock_manager.cpp
index eaa901ee04f..30468418643 100644
--- a/src/mongo/db/concurrency/lock_manager.cpp
+++ b/src/mongo/db/concurrency/lock_manager.cpp
@@ -118,6 +118,22 @@ namespace {
BOOST_STATIC_ASSERT(
(sizeof(ResourceTypeNames) / sizeof(ResourceTypeNames[0])) == ResourceTypesCount);
+
+ /**
+ * Maps the LockRequest status to a human-readable string.
+ */
+ static const char* LockRequestStatusNames[] = {
+ "new",
+ "granted",
+ "waiting",
+ "converting",
+ };
+
+ // Ensure we do not add new status types without updating the names array
+ BOOST_STATIC_ASSERT(
+ (sizeof(LockRequestStatusNames) / sizeof(LockRequestStatusNames[0]))
+ == LockRequest::StatusCount);
+
} // namespace
@@ -1132,4 +1148,8 @@ namespace {
return ResourceTypeNames[resourceType];
}
+ const char* lockRequestStatusName(LockRequest::Status status) {
+ return LockRequestStatusNames[status];
+ }
+
} // namespace mongo