revert last change to watchdog timeouts, that should not be needed
parent
baf8e762a6
commit
9224b5d680
|
@ -332,41 +332,37 @@ namespace OpenSim.Framework.Monitoring
|
|||
if (callback != null)
|
||||
{
|
||||
List<ThreadWatchdogInfo> callbackInfos = null;
|
||||
|
||||
// get a copy since we may change m_threads
|
||||
List<ThreadWatchdogInfo> threadsInfo;
|
||||
|
||||
lock (m_threads)
|
||||
threadsInfo = m_threads.Values.ToList();
|
||||
|
||||
foreach (ThreadWatchdogInfo threadInfo in threadsInfo)
|
||||
{
|
||||
lock (m_threads)
|
||||
// get a copy since we may change m_threads
|
||||
threadsInfo = m_threads.Values.ToList();
|
||||
|
||||
foreach(ThreadWatchdogInfo threadInfo in threadsInfo)
|
||||
{
|
||||
if(!m_threads.ContainsValue(threadInfo))
|
||||
continue;
|
||||
}
|
||||
|
||||
if(threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
||||
{
|
||||
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
||||
|
||||
if(callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
||||
{
|
||||
threadInfo.IsTimedOut = true;
|
||||
|
||||
if(threadInfo.AlarmIfTimeout)
|
||||
if(threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
||||
{
|
||||
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
||||
|
||||
if(callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
// Send a copy of the watchdog info to prevent race conditions where the watchdog
|
||||
// thread updates the monitoring info after an alarm has been sent out.
|
||||
callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
else if(!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
||||
{
|
||||
threadInfo.IsTimedOut = true;
|
||||
|
||||
if(threadInfo.AlarmIfTimeout)
|
||||
{
|
||||
if(callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
// Send a copy of the watchdog info to prevent race conditions where the watchdog
|
||||
// thread updates the monitoring info after an alarm has been sent out.
|
||||
callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue