diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.h | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 214cd64806e..f25e25f6fb1 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -54,7 +54,9 @@ using namespace Ice; using namespace IceInternal; int Instance::_globalStateCounter = 0; -IceUtil::StaticMutex* Instance::_globalStateMutex = new IceUtil::StaticMutex; + +IceUtil::Mutex* Instance::_globalStateMutex = new IceUtil::Mutex; + #ifndef _WIN32 string Instance::_identForOpenlog; #endif @@ -381,7 +383,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope _messageSizeMax(0), _connectionIdleTime(0) { - IceUtil::StaticMutex::Lock sync(*_globalStateMutex); + IceUtil::Mutex::Lock sync(*_globalStateMutex); ++_globalStateCounter; try diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 1fc5f03e712..c6b338ecf0b 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -16,7 +16,7 @@ #define ICE_INSTANCE_H #include <IceUtil/Shared.h> -#include <IceUtil/StaticMutex.h> +#include <IceUtil/Mutex.h> #include <IceUtil/RecMutex.h> #include <Ice/InstanceF.h> #include <Ice/CommunicatorF.h> @@ -110,9 +110,17 @@ private: // // Global state management // + friend class GlobalStateMutexDestroyer; + static int _globalStateCounter; - static IceUtil::StaticMutex* _globalStateMutex; + + // + // This is *not* a StaticMutex. Only the pointer is static, but not + // the mutex itself. + // + static IceUtil::Mutex* _globalStateMutex; + #ifndef _WIN32 static std::string _identForOpenlog; #endif |