mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
Refinement to ThreadPool::addCapacity() usage in TCPServer
This commit is contained in:
parent
b509b7e91a
commit
bf29f72cdf
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user