diff --git a/source/server/guarddog_impl.cc b/source/server/guarddog_impl.cc index 86b9d7a6d0fd..019a4b4c5c89 100644 --- a/source/server/guarddog_impl.cc +++ b/source/server/guarddog_impl.cc @@ -84,10 +84,10 @@ GuardDogImpl::GuardDogImpl(Stats::Scope& stats_scope, const Server::Configuratio GuardDogImpl::~GuardDogImpl() { stop(); } void GuardDogImpl::step() { - // Hold mutex_ for the duration of the step() function to ensure that watchdog liveness checks and - // test interlock operations happen in the expected order. Calls to forceCheckForTest() should - // result in a full iteration of the step() function to process recent watchdog touches and - // monotonic time changes. + // Hold mutex_ for the duration of the step() function to ensure that watchdog still alive checks + // and test interlocks happen in the expected order. Calls to forceCheckForTest() should result in + // a full iteration of the step() function to process recent watchdog touches and monotonic time + // changes. Thread::LockGuard guard(mutex_); if (!run_thread_) { return; diff --git a/source/server/watchdog_impl.h b/source/server/watchdog_impl.h index 940923415d7c..a18034745885 100644 --- a/source/server/watchdog_impl.h +++ b/source/server/watchdog_impl.h @@ -24,15 +24,14 @@ class WatchDogImpl : public WatchDog { Thread::ThreadId threadId() const override { return thread_id_; } // Used by GuardDogImpl determine if the watchdog was touched recently and reset the touch status. - bool getTouchedAndReset() { return touched_.exchange(false, std::memory_order_acq_rel); } + bool getTouchedAndReset() { return touched_.exchange(false, std::memory_order_relaxed); } // Server::WatchDog void startWatchdog(Event::Dispatcher& dispatcher) override; void touch() override { // Set touched_ if not already set. bool expected = false; - touched_.compare_exchange_strong(expected, true, std::memory_order_release, - std::memory_order_acquire); + touched_.compare_exchange_strong(expected, true, std::memory_order_relaxed); } private: