Take watchdog alarm calling back outside the m_threads lock.
This is how it was originally. This stops a very long running alarm callback from causing a problem.xassetservice
parent
9e6ffe7798
commit
bafef292f4
|
@ -262,7 +262,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
if (callback != null)
|
if (callback != null)
|
||||||
{
|
{
|
||||||
ThreadWatchdogInfo timedOut = null;
|
List<ThreadWatchdogInfo> callbackInfos = null;
|
||||||
|
|
||||||
lock (m_threads)
|
lock (m_threads)
|
||||||
{
|
{
|
||||||
|
@ -273,17 +273,30 @@ namespace OpenSim.Framework
|
||||||
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
||||||
{
|
{
|
||||||
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
||||||
callback(threadInfo.Thread, threadInfo.LastTick);
|
|
||||||
|
if (callbackInfos == null)
|
||||||
|
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||||
|
|
||||||
|
callbackInfos.Add(threadInfo);
|
||||||
}
|
}
|
||||||
else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
||||||
{
|
{
|
||||||
threadInfo.IsTimedOut = true;
|
threadInfo.IsTimedOut = true;
|
||||||
|
|
||||||
if (threadInfo.AlarmIfTimeout)
|
if (threadInfo.AlarmIfTimeout)
|
||||||
callback(threadInfo.Thread, threadInfo.LastTick);
|
{
|
||||||
|
if (callbackInfos == null)
|
||||||
|
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||||
|
|
||||||
|
callbackInfos.Add(threadInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (callbackInfos != null)
|
||||||
|
foreach (ThreadWatchdogInfo callbackInfo in callbackInfos)
|
||||||
|
callback(callbackInfo.Thread, callbackInfo.LastTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_watchdogTimer.Start();
|
m_watchdogTimer.Start();
|
||||||
|
|
|
@ -156,8 +156,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// that the region position is cached or performance will degrade
|
// that the region position is cached or performance will degrade
|
||||||
Utils.LongToUInts(regionHandle, out x, out y);
|
Utils.LongToUInts(regionHandle, out x, out y);
|
||||||
GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||||
bool v = true;
|
// bool v = true;
|
||||||
if (! simulatorList.Contains(dest.ServerURI))
|
if (!simulatorList.Contains(dest.ServerURI))
|
||||||
{
|
{
|
||||||
// we havent seen this simulator before, add it to the list
|
// we havent seen this simulator before, add it to the list
|
||||||
// and send it an update
|
// and send it an update
|
||||||
|
|
Loading…
Reference in New Issue