mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 16:48:06 +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();
|
Poco::ThreadPool& pool = Poco::ThreadPool::defaultPool();
|
||||||
if(pParams && (pParams->getMaxThreads() > pool.capacity())){
|
if(pParams) pool.addCapacity(pParams->getMaxThreads() - pool.capacity());
|
||||||
pool.addCapacity(pParams->getMaxThreads());
|
|
||||||
}
|
|
||||||
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
|
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -71,9 +69,7 @@ TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocke
|
|||||||
_stopped(true)
|
_stopped(true)
|
||||||
{
|
{
|
||||||
Poco::ThreadPool& pool = Poco::ThreadPool::defaultPool();
|
Poco::ThreadPool& pool = Poco::ThreadPool::defaultPool();
|
||||||
if(pParams && (pParams->getMaxThreads() > pool.capacity())){
|
if(pParams) pool.addCapacity(pParams->getMaxThreads() - pool.capacity());
|
||||||
pool.addCapacity(pParams->getMaxThreads());
|
|
||||||
}
|
|
||||||
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
|
_pDispatcher = new TCPServerDispatcher(pFactory, pool, pParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user