From eea0e92faa209f23b677fdee964023d0ce6f2fed Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:53 -0500 Subject: Second Life viewer sources 1.20.8 --- linden/indra/newview/llwatchdog.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview/llwatchdog.cpp') diff --git a/linden/indra/newview/llwatchdog.cpp b/linden/indra/newview/llwatchdog.cpp index 1dd984e..d92d381 100644 --- a/linden/indra/newview/llwatchdog.cpp +++ b/linden/indra/newview/llwatchdog.cpp @@ -74,6 +74,7 @@ LLWatchdogEntry::LLWatchdogEntry() LLWatchdogEntry::~LLWatchdogEntry() { + stop(); } void LLWatchdogEntry::start() @@ -87,8 +88,11 @@ void LLWatchdogEntry::stop() } // LLWatchdogTimeout +const std::string UNINIT_STRING = "uninitialized"; + LLWatchdogTimeout::LLWatchdogTimeout() : - mTimeout(0.0f) + mTimeout(0.0f), + mPingState(UNINIT_STRING) { } @@ -106,23 +110,28 @@ void LLWatchdogTimeout::setTimeout(F32 d) mTimeout = d; } -void LLWatchdogTimeout::start() +void LLWatchdogTimeout::start(const std::string& state) { // Order of operation is very impmortant here. // After LLWatchdogEntry::start() is called // LLWatchdogTimeout::isAlive() will be called asynchronously. mTimer.start(); - mTimer.setTimerExpirySec(mTimeout); + ping(state); LLWatchdogEntry::start(); } + void LLWatchdogTimeout::stop() { LLWatchdogEntry::stop(); mTimer.stop(); } -void LLWatchdogTimeout::ping() +void LLWatchdogTimeout::ping(const std::string& state) { + if(!state.empty()) + { + mPingState = state; + } mTimer.setTimerExpirySec(mTimeout); } -- cgit v1.1