diff options
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 031d3a723bd..d72faa0b850 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -232,7 +232,7 @@ IceInternal::Instance::serverThreadPool() return _serverThreadPool; } -bool +int IceInternal::Instance::threadPerConnection() const { // No mutex lock, immutable. @@ -457,7 +457,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _messageSizeMax(0), _clientACM(0), _serverACM(0), - _threadPerConnection(false), + _threadPerConnection(0), _threadPerConnectionStackSize(0), _defaultContext(new SharedContext(initData.defaultContext)) { @@ -629,7 +629,18 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi const_cast<Int&>(_clientACM) = _initData.properties->getPropertyAsIntWithDefault("Ice.ACM.Client", 60); const_cast<Int&>(_serverACM) = _initData.properties->getPropertyAsInt("Ice.ACM.Server"); - const_cast<bool&>(_threadPerConnection) = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection") > 0; + { + Int threadPerConnection = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection"); + if(threadPerConnection < 0) + { + threadPerConnection = 0; + } + if(threadPerConnection > 2) + { + threadPerConnection = 2; + } + const_cast<Int&>(_threadPerConnection) = threadPerConnection; + } { Int stackSize = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize"); |