Commit 7d300cab authored by Razvan Becheriu's avatar Razvan Becheriu

[#892] refactored

parent bc19ae29
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment