mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 00:07:59 +02:00
Refinement to ThreadPool::addCapacity() usage in TCPServer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user