summaryrefslogtreecommitdiff
path: root/src/mongo/util/log.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2013-01-18 17:57:53 -0500
committerMathias Stearn <mathias@10gen.com>2013-01-19 11:43:59 -0500
commite2ff104513136aec4874a644cec6800d65ab9fe3 (patch)
tree715d127a5b7afd0d36f8fc87959f42a259a51a14 /src/mongo/util/log.cpp
parent6497950cd222f39313d47bceee26d7d8f83f7acc (diff)
downloadmongo-e2ff104513136aec4874a644cec6800d65ab9fe3.tar.gz
Use fast thread-local for logging
Diffstat (limited to 'src/mongo/util/log.cpp')
-rw-r--r--src/mongo/util/log.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp
index 3af6467a6d5..f69ffbd5450 100644
--- a/src/mongo/util/log.cpp
+++ b/src/mongo/util/log.cpp
@@ -19,6 +19,7 @@
#include "mongo/pch.h"
#include "mongo/util/assert_util.h"
+#include "mongo/util/concurrency/threadlocal.h"
#include "mongo/util/stacktrace.h"
#include "mongo/util/time_support.h"
@@ -66,7 +67,8 @@ namespace mongo {
Nullstream nullstream;
vector<Tee*>* Logstream::globalTees = 0;
- thread_specific_ptr<Logstream> Logstream::tsp;
+ TSP_DECLARE(Logstream, Logstream_tsp);
+ TSP_DEFINE(Logstream, Logstream_tsp);
Nullstream& tlog( int level ) {
if ( !debug && level > tlogLevel )
@@ -423,9 +425,9 @@ namespace mongo {
if ( StaticObserver::_destroyingStatics ) {
cout << "Logstream::get called in uninitialized state" << endl;
}
- Logstream *p = tsp.get();
+ Logstream *p = Logstream_tsp.get();
if( p == 0 )
- tsp.reset( p = new Logstream() );
+ Logstream_tsp.reset( p = new Logstream() );
return *p;
}