summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectionFactory.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-01-27 21:11:36 +0000
committerMarc Laukien <marc@zeroc.com>2003-01-27 21:11:36 +0000
commite51106b81ce7c098de1bfef0b1cc0fd39763b97f (patch)
tree8b208a4ef512df2a66928fec0de3db28354bcfe6 /cpp/src/Ice/ConnectionFactory.cpp
parentAdded ICE_UTIL_API for nullHandleAbort (diff)
downloadice-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.cpp26
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;
}
}