From: Razvan Becheriu Date: Tue, 11 Feb 2020 08:17:07 +0000 (+0200) Subject: [#892] refactored X-Git-Tag: Kea-1.7.5~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d300cabc8cfec5553d5b5b5aa095730d5937f32;p=thirdparty%2Fkea.git [#892] refactored --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 1ace4c6833..6a2895adc6 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -803,7 +803,7 @@ Dhcpv4Srv::run() { } // destroying the thread pool - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { MultiThreadingMgr::instance().getPktThreadPool().reset(); } @@ -903,7 +903,7 @@ Dhcpv4Srv::run_one() { .arg(query->getLabel()); return; } else { - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { typedef function CallBack; boost::shared_ptr call_back = boost::make_shared(std::bind(&Dhcpv4Srv::processPacketAndSendResponseNoThrow, @@ -1221,7 +1221,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) { // library unparks the packet. HooksManager::park("leases4_committed", query, [this, callout_handle, query, rsp]() mutable { - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { typedef function CallBack; boost::shared_ptr call_back = boost::make_shared(std::bind(&Dhcpv4Srv::sendResponseNoThrow, diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index f89207b603..7ba4c8d951 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -473,7 +473,7 @@ bool Dhcpv6Srv::run() { } // destroying the thread pool - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { MultiThreadingMgr::instance().getPktThreadPool().reset(); } @@ -576,7 +576,7 @@ void Dhcpv6Srv::run_one() { .arg(query->getLabel()); return; } else { - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { typedef function CallBack; boost::shared_ptr call_back = boost::make_shared(std::bind(&Dhcpv6Srv::processPacketAndSendResponseNoThrow, @@ -980,7 +980,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) { // library unparks the packet. HooksManager::park("leases6_committed", query, [this, callout_handle, query, rsp]() mutable { - if (MultiThreadingUtil::threadCount()) { + if (MultiThreadingMgr::instance().getMode()) { typedef function CallBack; boost::shared_ptr call_back = boost::make_shared(std::bind(&Dhcpv6Srv::sendResponseNoThrow,