aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2015-11-27 13:32:49 +0000
committerUbitUmarov2015-11-27 13:32:49 +0000
commit9224b5d68049c0b8b3a5d7a9b3dcd6d5f4c1f005 (patch)
treeefe90618b4e071b793a0eae06eafdfc9fe507931 /OpenSim/Framework
parent change JobEngine stop code and add a extra check for thread removed on watch... (diff)
downloadopensim-SC-9224b5d68049c0b8b3a5d7a9b3dcd6d5f4c1f005.zip
opensim-SC-9224b5d68049c0b8b3a5d7a9b3dcd6d5f4c1f005.tar.gz
opensim-SC-9224b5d68049c0b8b3a5d7a9b3dcd6d5f4c1f005.tar.bz2
opensim-SC-9224b5d68049c0b8b3a5d7a9b3dcd6d5f4c1f005.tar.xz
revert last change to watchdog timeouts, that should not be needed
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs48
1 files changed, 22 insertions, 26 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 83f8e01..b2c1fb1 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -332,41 +332,37 @@ namespace OpenSim.Framework.Monitoring
332 if (callback != null) 332 if (callback != null)
333 { 333 {
334 List<ThreadWatchdogInfo> callbackInfos = null; 334 List<ThreadWatchdogInfo> callbackInfos = null;
335
336 // get a copy since we may change m_threads
337 List<ThreadWatchdogInfo> threadsInfo; 335 List<ThreadWatchdogInfo> threadsInfo;
336
338 lock (m_threads) 337 lock (m_threads)
339 threadsInfo = m_threads.Values.ToList();
340
341 foreach (ThreadWatchdogInfo threadInfo in threadsInfo)
342 { 338 {
343 lock (m_threads) 339 // get a copy since we may change m_threads
344 { 340 threadsInfo = m_threads.Values.ToList();
345 if(!m_threads.ContainsValue(threadInfo))
346 continue;
347 }
348
349 if(threadInfo.Thread.ThreadState == ThreadState.Stopped)
350 {
351 RemoveThread(threadInfo.Thread.ManagedThreadId);
352
353 if(callbackInfos == null)
354 callbackInfos = new List<ThreadWatchdogInfo>();
355 341
356 callbackInfos.Add(threadInfo); 342 foreach(ThreadWatchdogInfo threadInfo in threadsInfo)
357 }
358 else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
359 { 343 {
360 threadInfo.IsTimedOut = true; 344 if(threadInfo.Thread.ThreadState == ThreadState.Stopped)
361
362 if(threadInfo.AlarmIfTimeout)
363 { 345 {
346 RemoveThread(threadInfo.Thread.ManagedThreadId);
347
364 if(callbackInfos == null) 348 if(callbackInfos == null)
365 callbackInfos = new List<ThreadWatchdogInfo>(); 349 callbackInfos = new List<ThreadWatchdogInfo>();
366 350
367 // Send a copy of the watchdog info to prevent race conditions where the watchdog 351 callbackInfos.Add(threadInfo);
368 // thread updates the monitoring info after an alarm has been sent out. 352 }
369 callbackInfos.Add(new ThreadWatchdogInfo(threadInfo)); 353 else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
354 {
355 threadInfo.IsTimedOut = true;
356
357 if(threadInfo.AlarmIfTimeout)
358 {
359 if(callbackInfos == null)
360 callbackInfos = new List<ThreadWatchdogInfo>();
361
362 // Send a copy of the watchdog info to prevent race conditions where the watchdog
363 // thread updates the monitoring info after an alarm has been sent out.
364 callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
365 }
370 } 366 }
371 } 367 }
372 } 368 }