summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-08-11 16:48:54 -0400
committerEliot Horowitz <eliot@10gen.com>2010-09-15 11:03:27 -0400
commit71bedc0c8ebacc6e233f7d2001319eeea05bd91d (patch)
treefbb5bfa8a3c99f3d72bae9db678e46ce0390d037 /util
parent82ef5dd32f6941182c8eb6ff60339ab1aa8146a3 (diff)
downloadmongo-71bedc0c8ebacc6e233f7d2001319eeea05bd91d.tar.gz
mutexdebugger fix
Diffstat (limited to 'util')
-rw-r--r--util/concurrency/mutex.h2
-rw-r--r--util/concurrency/vars.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/util/concurrency/mutex.h b/util/concurrency/mutex.h
index 9ab3960cdd4..797ab77faaa 100644
--- a/util/concurrency/mutex.h
+++ b/util/concurrency/mutex.h
@@ -115,7 +115,7 @@ namespace mongo {
}
}
};
- extern MutexDebugger mutexDebugger;
+ extern MutexDebugger &mutexDebugger;
// If you create a local static instance of this class, that instance will be destroyed
// before all global static objects are destroyed, so __destroyingStatics will be set
diff --git a/util/concurrency/vars.cpp b/util/concurrency/vars.cpp
index 2b46946ff85..8863a278232 100644
--- a/util/concurrency/vars.cpp
+++ b/util/concurrency/vars.cpp
@@ -23,7 +23,9 @@
namespace mongo {
mutex _atomicMutex("_atomicMutex");
- MutexDebugger mutexDebugger;
+
+ // intentional leak. otherwise destructor orders can be problematic at termination.
+ MutexDebugger &mutexDebugger = *(new MutexDebugger());
MutexDebugger::MutexDebugger() :
x( *(new boost::mutex()) ), magic(0x12345678) {