diff options
author | Jacek Antonelli | 2008-08-15 23:45:53 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:53 -0500 |
commit | eea0e92faa209f23b677fdee964023d0ce6f2fed (patch) | |
tree | f8700989d9f799d4e818920ba54516e7cf975376 /linden/indra/newview/llwatchdog.cpp | |
parent | Second Life viewer sources 1.20.7 (diff) | |
download | meta-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.cpp | 17 |
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 | ||
75 | LLWatchdogEntry::~LLWatchdogEntry() | 75 | LLWatchdogEntry::~LLWatchdogEntry() |
76 | { | 76 | { |
77 | stop(); | ||
77 | } | 78 | } |
78 | 79 | ||
79 | void LLWatchdogEntry::start() | 80 | void LLWatchdogEntry::start() |
@@ -87,8 +88,11 @@ void LLWatchdogEntry::stop() | |||
87 | } | 88 | } |
88 | 89 | ||
89 | // LLWatchdogTimeout | 90 | // LLWatchdogTimeout |
91 | const std::string UNINIT_STRING = "uninitialized"; | ||
92 | |||
90 | LLWatchdogTimeout::LLWatchdogTimeout() : | 93 | LLWatchdogTimeout::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 | ||
109 | void LLWatchdogTimeout::start() | 113 | void 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 | |||
118 | void LLWatchdogTimeout::stop() | 123 | void LLWatchdogTimeout::stop() |
119 | { | 124 | { |
120 | LLWatchdogEntry::stop(); | 125 | LLWatchdogEntry::stop(); |
121 | mTimer.stop(); | 126 | mTimer.stop(); |
122 | } | 127 | } |
123 | 128 | ||
124 | void LLWatchdogTimeout::ping() | 129 | void 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 | ||