]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#892] refactored
authorRazvan Becheriu <razvan@isc.org>
Tue, 11 Feb 2020 08:17:07 +0000 (10:17 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 21 Feb 2020 15:41:31 +0000 (17:41 +0200)
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp6/dhcp6_srv.cc

index 1ace4c6833dfe14855f1c7a1881ff1be060a7abd..6a2895adc6ab82b856454700cbe1a2b38a011492 100644 (file)
@@ -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<void()> CallBack;
             boost::shared_ptr<CallBack> call_back =
                 boost::make_shared<CallBack>(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<void()> CallBack;
                 boost::shared_ptr<CallBack> call_back =
                     boost::make_shared<CallBack>(std::bind(&Dhcpv4Srv::sendResponseNoThrow,
index f89207b603cd77d1a43ef705d9fb346a9d524e72..7ba4c8d951faca1ae01053ddcc26acb281450e54 100644 (file)
@@ -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<void()> CallBack;
             boost::shared_ptr<CallBack> call_back =
                 boost::make_shared<CallBack>(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<void()> CallBack;
                 boost::shared_ptr<CallBack> call_back =
                     boost::make_shared<CallBack>(std::bind(&Dhcpv6Srv::sendResponseNoThrow,