From ac7ccdf7d77810aef0a3ad70f1504fdb111dc0aa Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 26 Oct 2009 14:41:27 -0700 Subject: * Changed the watchdog timer to improve the speed of UpdateThread(), only track threads once the first call to UpdateThread() has been made, and allow re-tracking of threads that timed out but revived later * Added a commented out call to Watchdog.UpdateThread() in OdeScene. If it turns out that loading a large OAR file or some other operation is timing out the heartbeat thread, we'll need to uncomment it --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f052c65..95d69a1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1025,6 +1025,7 @@ namespace OpenSim.Region.Framework.Scenes float physicsFPS = 0; frameMS = Environment.TickCount; + try { // Increment the frame counter @@ -1152,6 +1153,7 @@ namespace OpenSim.Region.Framework.Scenes if ((maintc < (m_timespan * 1000)) && maintc > 0) Thread.Sleep(maintc); + // Tell the watchdog that this thread is still alive Watchdog.UpdateThread(); } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f979ce3..82392b1 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -2705,8 +2705,6 @@ namespace OpenSim.Region.Physics.OdePlugin { foreach (OdePrim prim in _taintedPrimL) { - - if (prim.m_taintremove) { //Console.WriteLine("Simulate calls RemovePrimThreadLocked"); @@ -2719,6 +2717,12 @@ namespace OpenSim.Region.Physics.OdePlugin } processedtaints = true; prim.m_collisionscore = 0; + + // This loop can block up the Heartbeat for a very long time on large regions. + // We need to let the Watchdog know that the Heartbeat is not dead + // NOTE: This is currently commented out, but if things like OAR loading are + // timing the heartbeat out we will need to uncomment it + //Watchdog.UpdateThread(); } if (SupportsNINJAJoints) -- cgit v1.1