summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ObjectAdapterI.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-01-16 10:37:23 +0000
committerMatthew Newhook <matthew@zeroc.com>2007-01-16 10:37:23 +0000
commit8bccaa84b6b2c204608af57e1710028b7d71ff3f (patch)
treed2385d8753ceb677110d6d8c508a1bac837ef486 /cpp/src/Ice/ObjectAdapterI.cpp
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1665 (diff)
downloadice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.tar.bz2
ice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.tar.xz
ice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1179
Diffstat (limited to 'cpp/src/Ice/ObjectAdapterI.cpp')
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 27805c6a4e9..9338f35bd70 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -777,6 +777,33 @@ Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const Communica
__setNoDelete(true);
try
{
+ // First create the per-adapter thread pool, if
+ // necessary. This is done before the creation of the incoming
+ // connection factory as the thread pool is needed during
+ // creation for the call to incFdsInUse.
+ if(!_instance->threadPerConnection())
+ {
+ if(!properties->getProperty(_propertyPrefix + _name + ".ThreadPool.Size").empty() ||
+ !properties->getProperty(_propertyPrefix + _name + ".ThreadPool.SizeMax").empty())
+ {
+ int size = properties->getPropertyAsInt(_propertyPrefix + _name + ".ThreadPool.Size");
+ int sizeMax = properties->getPropertyAsInt(_propertyPrefix + _name + ".ThreadPool.SizeMax");
+ if(size > 0 || sizeMax > 0)
+ {
+ _threadPool = new ThreadPool(_instance, _propertyPrefix + _name + ".ThreadPool", 0);
+ }
+ }
+ else
+ {
+ int size = properties->getPropertyAsInt(_name + ".ThreadPool.Size");
+ int sizeMax = properties->getPropertyAsInt(_name + ".ThreadPool.SizeMax");
+ if(size > 0 || sizeMax > 0)
+ {
+ _threadPool = new ThreadPool(_instance, _name + ".ThreadPool", 0);
+ }
+ }
+ }
+
if(!router)
{
const_cast<RouterPrx&>(router) = RouterPrx::uncheckedCast(
@@ -890,29 +917,6 @@ Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const Communica
{
setLocator(_instance->referenceFactory()->getDefaultLocator());
}
-
- if(!_instance->threadPerConnection())
- {
- if(!properties->getProperty(_propertyPrefix + _name + ".ThreadPool.Size").empty() ||
- !properties->getProperty(_propertyPrefix + _name + ".ThreadPool.SizeMax").empty())
- {
- int size = properties->getPropertyAsInt(_propertyPrefix + _name + ".ThreadPool.Size");
- int sizeMax = properties->getPropertyAsInt(_propertyPrefix + _name + ".ThreadPool.SizeMax");
- if(size > 0 || sizeMax > 0)
- {
- _threadPool = new ThreadPool(_instance, _propertyPrefix + _name + ".ThreadPool", 0);
- }
- }
- else
- {
- int size = properties->getPropertyAsInt(_name + ".ThreadPool.Size");
- int sizeMax = properties->getPropertyAsInt(_name + ".ThreadPool.SizeMax");
- if(size > 0 || sizeMax > 0)
- {
- _threadPool = new ThreadPool(_instance, _name + ".ThreadPool", 0);
- }
- }
- }
}
catch(...)
{