From: Francis Dupont Date: Fri, 24 Apr 2020 19:07:28 +0000 (+0200) Subject: [#1095] Revert "[#1095] Protected communication state timer concurrent accesses" X-Git-Tag: Kea-1.7.8~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33d425fb0306b32d12d2f73aa41180104cddc79a;p=thirdparty%2Fkea.git [#1095] Revert "[#1095] Protected communication state timer concurrent accesses" This reverts commit d76566d0157911b2edb193a6e1e865d233094b8a. --- diff --git a/src/hooks/dhcp/high_availability/communication_state.cc b/src/hooks/dhcp/high_availability/communication_state.cc index a0414c8d78..f948976a29 100644 --- a/src/hooks/dhcp/high_availability/communication_state.cc +++ b/src/hooks/dhcp/high_availability/communication_state.cc @@ -46,8 +46,7 @@ namespace ha { CommunicationState::CommunicationState(const IOServicePtr& io_service, const HAConfigPtr& config) - : io_service_(io_service), config_(config), timer_(), - timer_mutex_(new std::mutex()), interval_(0), + : io_service_(io_service), config_(config), timer_(), interval_(0), poke_time_(boost::posix_time::microsec_clock::universal_time()), heartbeat_impl_(0), partner_state_(-1), partner_scopes_(), clock_skew_(0, 0, 0, 0), last_clock_skew_warn_(), @@ -94,7 +93,6 @@ CommunicationState::setPartnerScopes(ConstElementPtr new_scopes) { void CommunicationState::startHeartbeat(const long interval, const boost::function& heartbeat_impl) { - std::lock_guard lock(*timer_mutex_); startHeartbeatInternal(interval, heartbeat_impl); } @@ -141,7 +139,6 @@ CommunicationState::startHeartbeatInternal(const long interval, void CommunicationState::stopHeartbeat() { - std::lock_guard lock(*timer_mutex_); if (timer_) { timer_->cancel(); timer_.reset(); @@ -162,7 +159,6 @@ CommunicationState::poke() { // seems to be (re)established. clearUnackedClients(); - std::lock_guard lock(*timer_mutex_); if (timer_) { // Check the duration since last poke. If it is less than a second, we don't // want to reschedule the timer. The only case when the poke time duration is diff --git a/src/hooks/dhcp/high_availability/communication_state.h b/src/hooks/dhcp/high_availability/communication_state.h index 9d0966dc54..1ced58daec 100644 --- a/src/hooks/dhcp/high_availability/communication_state.h +++ b/src/hooks/dhcp/high_availability/communication_state.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -135,7 +134,6 @@ public: /// /// @return true if heartbeat is running, false otherwise. bool isHeartbeatRunning() const { - std::lock_guard lock(*timer_mutex_); return (static_cast(timer_)); } @@ -308,9 +306,6 @@ protected: /// @brief Interval timer triggering heartbeat commands. asiolink::IntervalTimerPtr timer_; - /// @brief Mutex to protect timer_ concurrent accesses. - boost::shared_ptr timer_mutex_; - /// @brief Interval specified for the heartbeat. long interval_;