aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwatchdog.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:53 -0500
committerJacek Antonelli2008-08-15 23:45:53 -0500
commiteea0e92faa209f23b677fdee964023d0ce6f2fed (patch)
treef8700989d9f799d4e818920ba54516e7cf975376 /linden/indra/newview/llwatchdog.cpp
parentSecond Life viewer sources 1.20.7 (diff)
downloadmeta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.zip
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.gz
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.bz2
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.xz
Second Life viewer sources 1.20.8
Diffstat (limited to 'linden/indra/newview/llwatchdog.cpp')
-rw-r--r--linden/indra/newview/llwatchdog.cpp17
1 files changed, 13 insertions, 4 deletions
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()
74 74
75LLWatchdogEntry::~LLWatchdogEntry() 75LLWatchdogEntry::~LLWatchdogEntry()
76{ 76{
77 stop();
77} 78}
78 79
79void LLWatchdogEntry::start() 80void LLWatchdogEntry::start()
@@ -87,8 +88,11 @@ void LLWatchdogEntry::stop()
87} 88}
88 89
89// LLWatchdogTimeout 90// LLWatchdogTimeout
91const std::string UNINIT_STRING = "uninitialized";
92
90LLWatchdogTimeout::LLWatchdogTimeout() : 93LLWatchdogTimeout::LLWatchdogTimeout() :
91 mTimeout(0.0f) 94 mTimeout(0.0f),
95 mPingState(UNINIT_STRING)
92{ 96{
93} 97}
94 98
@@ -106,23 +110,28 @@ void LLWatchdogTimeout::setTimeout(F32 d)
106 mTimeout = d; 110 mTimeout = d;
107} 111}
108 112
109void LLWatchdogTimeout::start() 113void LLWatchdogTimeout::start(const std::string& state)
110{ 114{
111 // Order of operation is very impmortant here. 115 // Order of operation is very impmortant here.
112 // After LLWatchdogEntry::start() is called 116 // After LLWatchdogEntry::start() is called
113 // LLWatchdogTimeout::isAlive() will be called asynchronously. 117 // LLWatchdogTimeout::isAlive() will be called asynchronously.
114 mTimer.start(); 118 mTimer.start();
115 mTimer.setTimerExpirySec(mTimeout); 119 ping(state);
116 LLWatchdogEntry::start(); 120 LLWatchdogEntry::start();
117} 121}
122
118void LLWatchdogTimeout::stop() 123void LLWatchdogTimeout::stop()
119{ 124{
120 LLWatchdogEntry::stop(); 125 LLWatchdogEntry::stop();
121 mTimer.stop(); 126 mTimer.stop();
122} 127}
123 128
124void LLWatchdogTimeout::ping() 129void LLWatchdogTimeout::ping(const std::string& state)
125{ 130{
131 if(!state.empty())
132 {
133 mPingState = state;
134 }
126 mTimer.setTimerExpirySec(mTimeout); 135 mTimer.setTimerExpirySec(mTimeout);
127} 136}
128 137