diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-03-02 09:17:30 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-03-02 09:17:30 +0000 |
commit | 2f7037965c40f4d68784f51613d5e9b9a395fcaa (patch) | |
tree | f056ed5d9a3e9ed678cc1b43c84e79422307031a /cppe/src/IceE/LoggerI.cpp | |
parent | windows fixes. (diff) | |
download | ice-2f7037965c40f4d68784f51613d5e9b9a395fcaa.tar.bz2 ice-2f7037965c40f4d68784f51613d5e9b9a395fcaa.tar.xz ice-2f7037965c40f4d68784f51613d5e9b9a395fcaa.zip |
- Fixes for Windows shutdown issue.
- Use a static mutex for the logger.
Diffstat (limited to 'cppe/src/IceE/LoggerI.cpp')
-rw-r--r-- | cppe/src/IceE/LoggerI.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cppe/src/IceE/LoggerI.cpp b/cppe/src/IceE/LoggerI.cpp index 1f34b743adc..c01609b4071 100644 --- a/cppe/src/IceE/LoggerI.cpp +++ b/cppe/src/IceE/LoggerI.cpp @@ -8,12 +8,13 @@ // ********************************************************************** #include <IceE/LoggerI.h> +#include <IceE/StaticMutex.h> using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Mutex Ice::LoggerI::_globalMutex; +static IceUtil::StaticMutex globalMutex = ICE_STATIC_MUTEX_INITIALIZER; Ice::LoggerI::LoggerI(const string& prefix) { @@ -26,7 +27,7 @@ Ice::LoggerI::LoggerI(const string& prefix) void Ice::LoggerI::print(const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(globalMutex); fprintf(stderr, "%s\n", message.c_str()); } @@ -34,7 +35,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(globalMutex); string s = "[ "; s += _prefix; @@ -56,13 +57,13 @@ 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(globalMutex); fprintf(stderr, "%swarning: %s\n", _prefix.c_str(), message.c_str()); } void Ice::LoggerI::error(const string& message) { - IceUtil::Mutex::Lock sync(_globalMutex); + IceUtil::StaticMutex::Lock sync(globalMutex); fprintf(stderr, "%serror: %s\n", _prefix.c_str(), message.c_str()); } |