From 114f26722933a5730eac7ff584eeebffdb974e52 Mon Sep 17 00:00:00 2001 From: Daniel Gottlieb Date: Thu, 8 Dec 2016 11:25:40 -0500 Subject: SERVER-25373: Add diagnostic labels to ResourceMutex instances --- src/mongo/db/concurrency/lock_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mongo/db/concurrency/lock_manager.cpp') diff --git a/src/mongo/db/concurrency/lock_manager.cpp b/src/mongo/db/concurrency/lock_manager.cpp index c569faf478d..815a235d623 100644 --- a/src/mongo/db/concurrency/lock_manager.cpp +++ b/src/mongo/db/concurrency/lock_manager.cpp @@ -36,6 +36,7 @@ #include "mongo/base/static_assert.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/config.h" +#include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/concurrency/locker.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" @@ -1123,6 +1124,9 @@ ResourceId::ResourceId(ResourceType type, uint64_t hashId) : _fullHash(fullHash( std::string ResourceId::toString() const { StringBuilder ss; ss << "{" << _fullHash << ": " << resourceTypeName(getType()) << ", " << getHashId(); + if (getType() == RESOURCE_MUTEX) { + ss << ", " << Lock::ResourceMutex::getName(*this); + } #ifdef MONGO_CONFIG_DEBUG_BUILD ss << ", " << _nsCopy; -- cgit v1.2.1