From 47fe6170b254968b383b636ffa0ee5925de4b479 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 23 Mar 2012 01:21:43 +0000 Subject: [PATCH] Rename Scene.StartTimer() to Start() - this method no longer uses a timer. Comment out more effectively unused old heartbeat code. --- OpenSim/Region/Application/OpenSimBase.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 49 ++++++++++++----------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f482d8f93c..696473c76b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -424,7 +424,7 @@ namespace OpenSim mscene = scene; - scene.StartTimer(); + scene.Start(); scene.StartScripts(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index bebe3124ca..8e5dd03e5f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -211,7 +211,7 @@ namespace OpenSim.Region.Framework.Scenes /// private bool m_cleaningTemps = false; - private Object m_heartbeatLock = new Object(); +// private Object m_heartbeatLock = new Object(); // TODO: Possibly stop other classes being able to manipulate this directly. private SceneGraph m_sceneGraph; @@ -1164,9 +1164,9 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Start the timer which triggers regular scene updates + /// Start the scene /// - public void StartTimer() + public void Start() { // m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName); @@ -1211,33 +1211,34 @@ namespace OpenSim.Region.Framework.Scenes /// private void Heartbeat() { - if (!Monitor.TryEnter(m_heartbeatLock)) - { - Watchdog.RemoveThread(); - return; - } +// if (!Monitor.TryEnter(m_heartbeatLock)) +// { +// Watchdog.RemoveThread(); +// return; +// } - try - { - m_eventManager.TriggerOnRegionStarted(this); +// try +// { - // The first frame can take a very long time due to physics actors being added on startup. Therefore, - // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false - // alarms for scenes with many objects. - Update(1); - Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; + m_eventManager.TriggerOnRegionStarted(this); - while (!shuttingdown) - Update(-1); + // The first frame can take a very long time due to physics actors being added on startup. Therefore, + // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false + // alarms for scenes with many objects. + Update(1); + Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; + + while (!shuttingdown) + Update(-1); // m_lastUpdate = Util.EnvironmentTickCount(); // m_firstHeartbeat = false; - } - finally - { - Monitor.Pulse(m_heartbeatLock); - Monitor.Exit(m_heartbeatLock); - } +// } +// finally +// { +// Monitor.Pulse(m_heartbeatLock); +// Monitor.Exit(m_heartbeatLock); +// } Watchdog.RemoveThread(); }