2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-04 07:55:18 +00:00

[#892] refactored

This commit is contained in:
Razvan Becheriu
2020-02-18 09:30:17 +02:00
parent 7d300cabc8
commit 16dfb865b1
8 changed files with 60 additions and 62 deletions

View File

@@ -803,9 +803,7 @@ Dhcpv4Srv::run() {
}
// destroying the thread pool
if (MultiThreadingMgr::instance().getMode()) {
MultiThreadingMgr::instance().getPktThreadPool().reset();
}
MultiThreadingMgr::instance().apply(false, 0);
return (true);
}
@@ -821,8 +819,8 @@ Dhcpv4Srv::run_one() {
// Do not read more packets from socket if there are enough
// packets to be processed in the packet thread pool queue
const int max_queue_size = MultiThreadingUtil::maxThreadQueueSize();
const int thread_count = MultiThreadingUtil::threadCount();
const int max_queue_size = CfgMgr::instance().getCurrentCfg()->getServerMaxThreadQueueSize();
const int thread_count = MultiThreadingMgr::instance().getPktThreadPoolSize();
size_t pkt_queue_size = MultiThreadingMgr::instance().getPktThreadPool().count();
if (thread_count && (pkt_queue_size >= thread_count * max_queue_size)) {
read_pkt = false;