Refinement to ThreadPool::addCapacity() usage in TCPServer

This commit is contained in:
karlr42 2014-03-07 12:22:27 +00:00
parent b509b7e91a
commit bf29f72cdf

View File

@ -57,9 +57,7 @@ TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::UInt16 port
{
Poco::ThreadPool& pool = Poco::ThreadPool::defaultPool();
if(pParams && (pParams->getMaxThreads() > pool.capacity())){
pool.addCapacity(pParams->getMaxThreads());
}
if(pParams) pool.addCapacity(pParams->getMaxThreads() - pool.capacity());
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
}
@ -71,9 +69,7 @@ TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocke
_stopped(true)
{
Poco::ThreadPool& pool = Poco::ThreadPool::defaultPool();
if(pParams && (pParams->getMaxThreads() > pool.capacity())){
pool.addCapacity(pParams->getMaxThreads());
}
if(pParams) pool.addCapacity(pParams->getMaxThreads() - pool.capacity());
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
}