diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-11-07 19:16:19 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-11-07 19:16:19 +0000 |
commit | c0d8c2634c22ecce5b478718000e87815c0cb3bb (patch) | |
tree | 4c816789c6904a69e61d56df36d734fff7ab4416 /cpp/src | |
parent | updating exception translation (diff) | |
download | ice-c0d8c2634c22ecce5b478718000e87815c0cb3bb.tar.bz2 ice-c0d8c2634c22ecce5b478718000e87815c0cb3bb.tar.xz ice-c0d8c2634c22ecce5b478718000e87815c0cb3bb.zip |
Replace static Mutex by static StaticMutex
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 11 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.h | 7 |
2 files changed, 6 insertions, 12 deletions
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index 4dd3f9a35c1..b9cb6654e73 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -9,12 +9,13 @@ #include <IceUtil/Time.h> #include <Ice/LoggerI.h> +#include <IceUtil/StaticMutex.h> using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Mutex Ice::LoggerI::_globalMutex; +static IceUtil::StaticMutex outputMutex = ICE_STATIC_MUTEX_INITIALIZER; Ice::LoggerI::LoggerI(const string& prefix, bool timestamp) : _timestamp(timestamp) @@ -28,7 +29,7 @@ Ice::LoggerI::LoggerI(const string& prefix, bool timestamp) : void Ice::LoggerI::print(const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(outputMutex); cerr << message << endl; } @@ -36,7 +37,7 @@ Ice::LoggerI::print(const string& message) void Ice::LoggerI::trace(const string& category, const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(outputMutex); string s = "[ "; if(_timestamp) @@ -62,7 +63,7 @@ Ice::LoggerI::trace(const string& category, const string& message) void Ice::LoggerI::warning(const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(outputMutex); if(_timestamp) { cerr << IceUtil::Time::now().toString() << " "; @@ -73,7 +74,7 @@ Ice::LoggerI::warning(const string& message) void Ice::LoggerI::error(const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(outputMutex); if(_timestamp) { cerr << IceUtil::Time::now().toString() << " "; diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 08bc0151b78..8cdb01d7d5a 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -10,7 +10,6 @@ #ifndef ICE_LOGGER_I_H #define ICE_LOGGER_I_H -#include <IceUtil/Mutex.h> #include <Ice/Logger.h> namespace Ice @@ -32,12 +31,6 @@ private: std::string _prefix; std::string _emptyPrefix; bool _timestamp; - - // - // A global mutex is used to avoid garbled output with multiple - // communicators. - // - static IceUtil::Mutex _globalMutex; }; } |