summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Initialize.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2015-09-11 14:30:00 -0400
committerJoe George <joe@zeroc.com>2015-09-11 14:30:00 -0400
commitb9c2a6f6628476f11c78a7de2adc90edca1e209e (patch)
treedf192d87dfbc594a7a2b52a96b5145ad3156d26f /cpp/src/Ice/Initialize.cpp
parentICE-6645 Removed hack to keep binary compatibility in Ice 3.6.1 (diff)
parentRemoved ARM configuraton from WinRT testsuite solutions (diff)
downloadice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.tar.bz2
ice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.tar.xz
ice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.zip
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r--cpp/src/Ice/Initialize.cpp54
1 files changed, 25 insertions, 29 deletions
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index 655a37920de..bc29df15d75 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -40,6 +40,27 @@ makePair(const vector<Byte>& v)
}
}
+IceUtil::Mutex* globalMutex = 0;
+Ice::LoggerPtr processLogger;
+
+class Init
+{
+public:
+
+ Init()
+ {
+ globalMutex = new IceUtil::Mutex;
+ }
+
+ ~Init()
+ {
+ delete globalMutex;
+ globalMutex = 0;
+ }
+};
+
+Init init;
+
}
StringSeq
@@ -303,36 +324,10 @@ Ice::createOutputStream(const CommunicatorPtr& communicator, const EncodingVersi
return new OutputStreamI(communicator, v);
}
-static IceUtil::Mutex* processLoggerMutex = 0;
-static Ice::LoggerPtr processLogger;
-
-namespace
-{
-
-class Init
-{
-public:
-
- Init()
- {
- processLoggerMutex = new IceUtil::Mutex;
- }
-
- ~Init()
- {
- delete processLoggerMutex;
- processLoggerMutex = 0;
- }
-};
-
-Init init;
-
-}
-
LoggerPtr
Ice::getProcessLogger()
{
- IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(processLoggerMutex);
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(globalMutex);
if(processLogger == 0)
{
@@ -347,13 +342,14 @@ Ice::getProcessLogger()
void
Ice::setProcessLogger(const LoggerPtr& logger)
{
- IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(processLoggerMutex);
- processLogger = logger;
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(globalMutex);
+ processLogger = logger;
}
void
Ice::registerPluginFactory(const std::string& name, PLUGIN_FACTORY factory, bool loadOnInitialize)
{
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(globalMutex);
PluginManagerI::registerPluginFactory(name, factory, loadOnInitialize);
}