diff options
author | Marc Laukien <marc@zeroc.com> | 2003-01-27 21:11:36 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-01-27 21:11:36 +0000 |
commit | e51106b81ce7c098de1bfef0b1cc0fd39763b97f (patch) | |
tree | 8b208a4ef512df2a66928fec0de3db28354bcfe6 /cpp/src/Ice/ConnectionFactory.cpp | |
parent | Added ICE_UTIL_API for nullHandleAbort (diff) | |
download | ice-e51106b81ce7c098de1bfef0b1cc0fd39763b97f.tar.bz2 ice-e51106b81ce7c098de1bfef0b1cc0fd39763b97f.tar.xz ice-e51106b81ce7c098de1bfef0b1cc0fd39763b97f.zip |
restructuring
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 3eb94fd159e..78ea8fbfb5b 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -23,7 +23,7 @@ #include <Ice/Connector.h> #include <Ice/Acceptor.h> #include <Ice/ThreadPool.h> -#include <Ice/ObjectAdapter.h> +#include <Ice/ObjectAdapterI.h> // For getThreadPool(). #include <Ice/Reference.h> #include <Ice/Endpoint.h> #include <Ice/RouterInfo.h> @@ -719,31 +719,19 @@ IceInternal::IncomingConnectionFactory::setState(State state) void IceInternal::IncomingConnectionFactory::registerWithPool() { - if(_acceptor) + if(_acceptor && !_registeredWithPool) { - if(!_registeredWithPool) - { - if(!_serverThreadPool) // Lazy initialization. - { - const_cast<ThreadPoolPtr&>(_serverThreadPool) = _instance->serverThreadPool(); - assert(_serverThreadPool); - } - _serverThreadPool->_register(_acceptor->fd(), this); - _registeredWithPool = true; - } + dynamic_cast<ObjectAdapterI*>(_adapter.get())->getThreadPool()->_register(_acceptor->fd(), this); + _registeredWithPool = true; } } void IceInternal::IncomingConnectionFactory::unregisterWithPool() { - if(_acceptor) + if(_acceptor && _registeredWithPool) { - if(_registeredWithPool) - { - assert(_serverThreadPool); - _serverThreadPool->unregister(_acceptor->fd()); - _registeredWithPool = false; - } + dynamic_cast<ObjectAdapterI*>(_adapter.get())->getThreadPool()->unregister(_acceptor->fd()); + _registeredWithPool = false; } } |