aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwatchdog.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-01-11 16:10:10 -0600
committerJacek Antonelli2009-01-11 16:10:15 -0600
commit6156baad67c744ed03ea47798bfeb8a77698efc6 (patch)
tree872d35ff6df740462d8cb574d03f746dfd5dd1ae /linden/indra/newview/llwatchdog.cpp
parentSecond Life viewer sources 1.22.3-RC (diff)
downloadmeta-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.cpp24
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
36const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000; 36const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000;
37 37
38void 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.
39class LLWatchdogTimerThread : public LLThread 48class 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)
146LLWatchdog::LLWatchdog() : 155LLWatchdog::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
171void LLWatchdog::init() 181void 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