From: Razvan Becheriu Date: Thu, 4 Jun 2020 21:39:46 +0000 (+0300) Subject: [#1239] communication state is now Kea thread safe X-Git-Tag: Kea-1.7.9~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4df48a44975646cddf2a204c49c9f29572f4c85;p=thirdparty%2Fkea.git [#1239] communication state is now Kea thread safe --- diff --git a/src/hooks/dhcp/high_availability/communication_state.cc b/src/hooks/dhcp/high_availability/communication_state.cc index 9bac62e578..80f82e6352 100644 --- a/src/hooks/dhcp/high_availability/communication_state.cc +++ b/src/hooks/dhcp/high_availability/communication_state.cc @@ -359,7 +359,8 @@ CommunicationState::getReport() const { CommunicationState4::CommunicationState4(const IOServicePtr& io_service, const HAConfigPtr& config) - : CommunicationState(io_service, config), connecting_clients_() { + : CommunicationState(io_service, config), connecting_clients_(), + mutex_(new mutex()) { } void @@ -465,7 +466,7 @@ CommunicationState4::failureDetected() const { bool CommunicationState4::failureDetectedInternal() const { return ((config_->getMaxUnackedClients() == 0) || - (getUnackedClientsCount() > config_->getMaxUnackedClients())); + (getUnackedClientsCountInternal() > config_->getMaxUnackedClients())); } size_t @@ -515,7 +516,8 @@ CommunicationState4::clearConnectingClientsInternal() { CommunicationState6::CommunicationState6(const IOServicePtr& io_service, const HAConfigPtr& config) - : CommunicationState(io_service, config), connecting_clients_() { + : CommunicationState(io_service, config), connecting_clients_(), + mutex_(new mutex()){ } void @@ -609,7 +611,7 @@ CommunicationState6::failureDetected() const { bool CommunicationState6::failureDetectedInternal() const { return ((config_->getMaxUnackedClients() == 0) || - (getUnackedClientsCount() > config_->getMaxUnackedClients())); + (getUnackedClientsCountInternal() > config_->getMaxUnackedClients())); } size_t