diff --git a/src/ripple/app/main/LoadManager.cpp b/src/ripple/app/main/LoadManager.cpp index cc431bca97..6a80803365 100644 --- a/src/ripple/app/main/LoadManager.cpp +++ b/src/ripple/app/main/LoadManager.cpp @@ -61,13 +61,14 @@ void LoadManager::activateDeadlockDetector () { std::lock_guard sl (mutex_); armed_ = true; + deadLock_ = std::chrono::steady_clock::now(); } void LoadManager::resetDeadlockDetector () { - auto const elapsedSeconds = UptimeClock::now(); + auto const detector_start = std::chrono::steady_clock::now(); std::lock_guard sl (mutex_); - deadLock_ = elapsedSeconds; + deadLock_ = detector_start; } //------------------------------------------------------------------------------ @@ -121,7 +122,9 @@ void LoadManager::run () sl.unlock(); // Measure the amount of time we have been deadlocked, in seconds. - auto const timeSpentDeadlocked = UptimeClock::now() - deadLock; + using namespace std::chrono; + auto const timeSpentDeadlocked = + duration_cast(steady_clock::now() - deadLock); auto const reportingIntervalSeconds = 10s; if (armed && (timeSpentDeadlocked >= reportingIntervalSeconds)) diff --git a/src/ripple/app/main/LoadManager.h b/src/ripple/app/main/LoadManager.h index 8f61505204..467487a586 100644 --- a/src/ripple/app/main/LoadManager.h +++ b/src/ripple/app/main/LoadManager.h @@ -95,7 +95,7 @@ private: std::thread thread_; std::mutex mutex_; // Guards deadLock_, armed_, and stop_. - UptimeClock::time_point deadLock_; // Detect server deadlocks. + std::chrono::steady_clock::time_point deadLock_; // Detect server deadlocks. bool armed_; bool stop_;