diff options
author | Jacek Antonelli | 2009-01-11 16:10:10 -0600 |
---|---|---|
committer | Jacek Antonelli | 2009-01-11 16:10:15 -0600 |
commit | 6156baad67c744ed03ea47798bfeb8a77698efc6 (patch) | |
tree | 872d35ff6df740462d8cb574d03f746dfd5dd1ae /linden/indra/newview/llwatchdog.cpp | |
parent | Second Life viewer sources 1.22.3-RC (diff) | |
download | meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.zip meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.gz meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.bz2 meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.xz |
Second Life viewer sources 1.22.4-RC
Diffstat (limited to 'linden/indra/newview/llwatchdog.cpp')
-rw-r--r-- | linden/indra/newview/llwatchdog.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/linden/indra/newview/llwatchdog.cpp b/linden/indra/newview/llwatchdog.cpp index e37bbd8..bb987c9 100644 --- a/linden/indra/newview/llwatchdog.cpp +++ b/linden/indra/newview/llwatchdog.cpp | |||
@@ -35,6 +35,15 @@ | |||
35 | 35 | ||
36 | const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000; | 36 | const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000; |
37 | 37 | ||
38 | void default_killer_callback() | ||
39 | { | ||
40 | #ifdef LL_WINDOWS | ||
41 | RaiseException(0,0,0,0); | ||
42 | #else | ||
43 | raise(SIGQUIT); | ||
44 | #endif | ||
45 | } | ||
46 | |||
38 | // This class runs the watchdog timing thread. | 47 | // This class runs the watchdog timing thread. |
39 | class LLWatchdogTimerThread : public LLThread | 48 | class LLWatchdogTimerThread : public LLThread |
40 | { | 49 | { |
@@ -52,7 +61,7 @@ public: | |||
52 | void stop() | 61 | void stop() |
53 | { | 62 | { |
54 | mStopping = true; | 63 | mStopping = true; |
55 | ms_sleep(1); | 64 | mSleepMsecs = 1; |
56 | } | 65 | } |
57 | 66 | ||
58 | /* virtual */ void run() | 67 | /* virtual */ void run() |
@@ -146,7 +155,8 @@ void LLWatchdogTimeout::ping(const std::string& state) | |||
146 | LLWatchdog::LLWatchdog() : | 155 | LLWatchdog::LLWatchdog() : |
147 | mSuspectsAccessMutex(NULL), | 156 | mSuspectsAccessMutex(NULL), |
148 | mTimer(NULL), | 157 | mTimer(NULL), |
149 | mLastClockCount(0) | 158 | mLastClockCount(0), |
159 | mKillerCallback(&default_killer_callback) | ||
150 | { | 160 | { |
151 | } | 161 | } |
152 | 162 | ||
@@ -168,8 +178,9 @@ void LLWatchdog::remove(LLWatchdogEntry* e) | |||
168 | unlockThread(); | 178 | unlockThread(); |
169 | } | 179 | } |
170 | 180 | ||
171 | void LLWatchdog::init() | 181 | void LLWatchdog::init(killer_event_callback func) |
172 | { | 182 | { |
183 | mKillerCallback = func; | ||
173 | if(!mSuspectsAccessMutex && !mTimer) | 184 | if(!mSuspectsAccessMutex && !mTimer) |
174 | { | 185 | { |
175 | mSuspectsAccessMutex = new LLMutex(NULL); | 186 | mSuspectsAccessMutex = new LLMutex(NULL); |
@@ -238,12 +249,7 @@ void LLWatchdog::run() | |||
238 | } | 249 | } |
239 | 250 | ||
240 | llinfos << "Watchdog detected error:" << llendl; | 251 | llinfos << "Watchdog detected error:" << llendl; |
241 | #ifdef LL_WINDOWS | 252 | mKillerCallback(); |
242 | llerrs << "Windows Watchdog killer event" << llendl; | ||
243 | // RaiseException(0,0,0,0); | ||
244 | #else | ||
245 | raise(SIGQUIT); | ||
246 | #endif | ||
247 | } | 253 | } |
248 | } | 254 | } |
249 | 255 | ||