From: Wlodek Wencel Date: Wed, 19 Feb 2020 08:54:59 +0000 (+0100) Subject: [#1021] removed mutex X-Git-Tag: Kea-1.7.5~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73032ef6b2b0c220c33e7fd243efcc683a825f1a;p=thirdparty%2Fkea.git [#1021] removed mutex --- diff --git a/src/bin/perfdhcp/test_control.h b/src/bin/perfdhcp/test_control.h index e54e7229c9..d9d88c271b 100644 --- a/src/bin/perfdhcp/test_control.h +++ b/src/bin/perfdhcp/test_control.h @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -300,19 +299,13 @@ public: /// Method prints information about data offsets /// in packet templates and their contents. void printTemplates() const; - std::mutex unique_addr_mutex_; - std::mutex unique_reply_addr_mutex_; std::set getAllUniqueAddrReply() { - std::lock_guard lock(unique_reply_addr_mutex_); - auto result = unique_reply_address_; - return result; + return unique_reply_address_; } std::set getAllUniqueAddrAdvert() { - std::lock_guard lock(unique_addr_mutex_); - auto result = unique_address_; - return result; + return unique_address_; } // We would really like following methods and members to be private but @@ -588,7 +581,6 @@ protected: case ExchangeType::SA: { for (auto current_it = current.begin(); current_it != current.end(); ++current_it) { - std::lock_guard lock(unique_addr_mutex_); auto ret = unique_address_.emplace(*current_it); if (!ret.second) { stats_mgr_.updateNonUniqueAddrNum(ExchangeType::SA); @@ -599,7 +591,6 @@ protected: case ExchangeType::RR: { for (auto current_it = current.begin(); current_it != current.end(); ++current_it) { - std::lock_guard lock(unique_reply_addr_mutex_); auto ret = unique_reply_address_.emplace(*current_it); if (!ret.second) { stats_mgr_.updateNonUniqueAddrNum(ExchangeType::RR); @@ -613,7 +604,6 @@ protected: case ExchangeType::DO: { for (auto current_it = current.begin(); current_it != current.end(); ++current_it) { - std::lock_guard lock(unique_addr_mutex_); auto ret = unique_address_.emplace(*current_it); if (!ret.second) { stats_mgr_.updateNonUniqueAddrNum(ExchangeType::DO); @@ -624,7 +614,6 @@ protected: case ExchangeType::RA: { for (auto current_it = current.begin(); current_it != current.end(); ++current_it) { - std::lock_guard lock(unique_reply_addr_mutex_); auto ret = unique_reply_address_.emplace(*current_it); if (!ret.second) { stats_mgr_.updateNonUniqueAddrNum(ExchangeType::RA); @@ -648,13 +637,11 @@ protected: for (auto addr_it = addr.begin(); addr_it != addr.end(); ++addr_it) { - std::lock_guard lock(unique_addr_mutex_); auto it = unique_address_.find(*addr_it); if (it != unique_address_.end()) { unique_address_.erase(it); } - std::lock_guard lock2(unique_reply_addr_mutex_); auto it2 = unique_reply_address_.find(*addr_it); if (it2 != unique_reply_address_.end()) { unique_reply_address_.erase(it2);