diff options
author | Marc Laukien <marc@zeroc.com> | 2002-03-09 15:45:51 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-03-09 15:45:51 +0000 |
commit | 145ae53e3f172a6454e44db994dd66a7a62e1f01 (patch) | |
tree | f8b655a2d9e7a980ef348178e9fb915c819928ca /cpp/src | |
parent | fixes (diff) | |
download | ice-145ae53e3f172a6454e44db994dd66a7a62e1f01.tar.bz2 ice-145ae53e3f172a6454e44db994dd66a7a62e1f01.tar.xz ice-145ae53e3f172a6454e44db994dd66a7a62e1f01.zip |
fixes
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.h | 10 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.h | 1 | ||||
-rw-r--r-- | cpp/src/Ice/SysLoggerI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/SysLoggerI.h | 1 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 28 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.h | 4 |
8 files changed, 26 insertions, 33 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index e81d604e059..02462e9a580 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -304,9 +304,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope IceInternal::Instance::~Instance() { assert(!_communicator); - assert(!_properties); - assert(!_logger); - assert(!_traceLevels); assert(!_referenceFactory); assert(!_proxyFactory); assert(!_outgoingConnectionFactory); diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index a883dd8a5a7..4015527d9ba 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -66,9 +66,9 @@ private: friend class ::Ice::CommunicatorI; ::Ice::CommunicatorPtr _communicator; - ::Ice::PropertiesPtr _properties; - ::Ice::LoggerPtr _logger; - TraceLevelsPtr _traceLevels; + ::Ice::PropertiesPtr _properties; // Immutable, not reset by destroy(). + ::Ice::LoggerPtr _logger; // Not reset by destroy(). + TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy(). RouterManagerPtr _routerManager; ReferenceFactoryPtr _referenceFactory; ProxyFactoryPtr _proxyFactory; @@ -77,8 +77,8 @@ private: UserExceptionFactoryManagerPtr _userExceptionFactoryManager; ObjectAdapterFactoryPtr _objectAdapterFactory; ThreadPoolPtr _threadPool; - std::string _defaultProtocol; - std::string _defaultHost; + std::string _defaultProtocol; // Immutable, not reset by destroy(). + std::string _defaultHost; // Immutable, not reset by destroy(). // // Global state management diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index e320af6b06c..cc361d98804 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -43,9 +43,3 @@ Ice::LoggerI::error(const string& message) IceUtil::Mutex::Lock sync(*this); cerr << "error: " << message << endl; } - -void -Ice::LoggerI::destroy() -{ - // Nothing to do -} diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 209350026e8..d7866b8e462 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -24,7 +24,6 @@ public: virtual void trace(const std::string&, const std::string&); virtual void warning(const std::string&); virtual void error(const std::string&); - virtual void destroy(); }; } diff --git a/cpp/src/Ice/SysLoggerI.cpp b/cpp/src/Ice/SysLoggerI.cpp index 43fea7dd0f0..43a87e16802 100644 --- a/cpp/src/Ice/SysLoggerI.cpp +++ b/cpp/src/Ice/SysLoggerI.cpp @@ -42,9 +42,3 @@ Ice::SysLoggerI::error(const string& message) IceUtil::Mutex::Lock sync(*this); syslog(LOG_ERR, "%s", message.c_str()); } - -void -Ice::SysLoggerI::destroy() -{ - // Nothing to do -} diff --git a/cpp/src/Ice/SysLoggerI.h b/cpp/src/Ice/SysLoggerI.h index 5ff132a7dc7..8ddde95cf7e 100644 --- a/cpp/src/Ice/SysLoggerI.h +++ b/cpp/src/Ice/SysLoggerI.h @@ -24,7 +24,6 @@ public: virtual void trace(const std::string&, const std::string&); virtual void warning(const std::string&); virtual void error(const std::string&); - virtual void destroy(); }; } diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 4a09bf995c0..5c8caa70197 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -75,7 +75,7 @@ IceInternal::ThreadPool::waitUntilServerFinished() if (_servers != 0) { - Error out(_instance->logger()); + Error out(_logger); out << "can't wait for graceful server termination in thread pool\n" << "since all threads have vanished"; } @@ -93,7 +93,7 @@ IceInternal::ThreadPool::waitUntilFinished() if (!_handlerMap.empty()) { - Error out(_instance->logger()); + Error out(_logger); out << "can't wait for graceful application termination in thread pool\n" << "since all threads have vanished"; } @@ -137,6 +137,8 @@ IceInternal::ThreadPool::getMaxConnections() IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance) : _instance(instance), + _logger(_instance->logger()), + _properties(_instance->properties()), _destroyed(false), _lastFd(INVALID_SOCKET), _servers(0), @@ -153,8 +155,8 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance) : _maxFd = _fdIntrRead; _minFd = _fdIntrRead; - _timeout = atoi(_instance->properties()->getProperty("Ice.ServerIdleTime").c_str()); - _threadNum = atoi(_instance->properties()->getPropertyWithDefault("Ice.ThreadPool.Size", "10").c_str()); + _timeout = atoi(_properties->getProperty("Ice.ServerIdleTime").c_str()); + _threadNum = atoi(_properties->getPropertyWithDefault("Ice.ThreadPool.Size", "10").c_str()); if (_threadNum < 1) { _threadNum = 1; @@ -179,7 +181,7 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance) : } // Must be called after _threadNum is set. - setMaxConnections(atoi(_instance->properties()->getProperty("Ice.ThreadPool.MaxConnections").c_str())); + setMaxConnections(atoi(_properties->getProperty("Ice.ThreadPool.MaxConnections").c_str())); } IceInternal::ThreadPool::~ThreadPool() @@ -243,7 +245,11 @@ IceInternal::ThreadPool::run() if (shutdown) // Shutdown has been initiated. { shutdown = false; - _instance->objectAdapterFactory()->shutdown(); + ObjectAdapterFactoryPtr factory = _instance->objectAdapterFactory(); + if (factory) + { + _instance->objectAdapterFactory()->shutdown(); + } } fd_set fdSet; @@ -361,7 +367,7 @@ IceInternal::ThreadPool::run() // if (fdSet.fd_count == 0) { - Error out(_instance->logger()); + Error out(_logger); out << "select() in thread pool returned " << ret << " but no filedescriptor is readable"; goto repeatSelect; } @@ -413,7 +419,7 @@ IceInternal::ThreadPool::run() if (loops > 1) { - Error out(_instance->logger()); + Error out(_logger); out << "select() in thread pool returned " << ret << " but no filedescriptor is readable"; goto repeatSelect; } @@ -428,7 +434,7 @@ IceInternal::ThreadPool::run() map<SOCKET, EventHandlerPtr>::iterator p = _handlerMap.find(_lastFd); if(p == _handlerMap.end()) { - Error out(_instance->logger()); + Error out(_logger); out << "filedescriptor " << _lastFd << " not registered with the thread pool"; goto repeatSelect; } @@ -535,12 +541,12 @@ IceInternal::ThreadPool::EventHandlerThread::run() } catch (const Exception& ex) { - Error out(_pool->_instance->logger()); + Error out(_pool->_logger); out << "exception in thread pool:\n" << ex; } catch (...) { - Error out(_pool->_instance->logger()); + Error out(_pool->_logger); out << "unknown exception in thread pool"; } diff --git a/cpp/src/Ice/ThreadPool.h b/cpp/src/Ice/ThreadPool.h index d829efa73f4..973df01bff2 100644 --- a/cpp/src/Ice/ThreadPool.h +++ b/cpp/src/Ice/ThreadPool.h @@ -18,6 +18,8 @@ #include <Ice/ThreadPoolF.h> #include <Ice/InstanceF.h> +#include <Ice/LoggerF.h> +#include <Ice/PropertiesF.h> #include <Ice/EventHandlerF.h> #include <list> @@ -58,6 +60,8 @@ private: void read(const EventHandlerPtr&); InstancePtr _instance; + ::Ice::LoggerPtr _logger; + ::Ice::PropertiesPtr _properties; bool _destroyed; SOCKET _maxFd; SOCKET _minFd; |