From 41f2f3132bdcbfb8020c7fd6e5f3b7e48c75b1cf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Sep 2014 23:20:59 +0100 Subject: For monitoring purposes, start non-timeout tasks (which do not currently use a threadpool) via Watchdog.RunInThread() rather than Util.RunThreadNoTimeout() The functionality is the same but this allow us to monitor such tasks via "show threads" and abort them for test purposes, etc. Also extends thread names to provide more info (e.g. SendInitialDataToClient says what client the task is for). --- OpenSim/Region/Framework/Scenes/Scene.cs | 17 +++++++---------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5f0dbd7..28dbccb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1623,7 +1623,12 @@ namespace OpenSim.Region.Framework.Scenes { tmpMS = Util.EnvironmentTickCount(); m_cleaningTemps = true; - Util.RunThreadNoTimeout(delegate { CleanTempObjects(); m_cleaningTemps = false; }, "CleanTempObjects", null); + + Watchdog.RunInThread( + delegate { CleanTempObjects(); m_cleaningTemps = false; }, + string.Format("CleanTempObjects ({0})", Name), + null); + tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpMS); } @@ -1803,7 +1808,7 @@ namespace OpenSim.Region.Framework.Scenes if (!m_backingup) { m_backingup = true; - Util.RunThreadNoTimeout(BackupWaitCallback, "BackupWaitCallback", null); + Watchdog.RunInThread(o => Backup(false), string.Format("BackupWaitCallback ({0})", Name), null); } } @@ -1814,14 +1819,6 @@ namespace OpenSim.Region.Framework.Scenes { m_eventManager.TriggerOnFrame(); } - - /// - /// Wrapper for Backup() that can be called with Util.RunThreadNoTimeout() - /// - private void BackupWaitCallback(object o) - { - Backup(false); - } /// /// Backup the scene. diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3c37de8..59b521d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -37,6 +37,7 @@ using log4net; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Client; +using OpenSim.Framework.Monitoring; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Animation; using OpenSim.Region.Framework.Scenes.Types; @@ -3362,7 +3363,7 @@ namespace OpenSim.Region.Framework.Scenes SentInitialDataToClient = true; // Send all scene object to the new client - Util.RunThreadNoTimeout(delegate + Watchdog.RunInThread(delegate { // m_log.DebugFormat( // "[SCENE PRESENCE]: Sending initial data to {0} agent {1} in {2}, tp flags {3}", @@ -3380,8 +3381,7 @@ namespace OpenSim.Region.Framework.Scenes if (e != null && e is SceneObjectGroup) ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); } - - }, "SendInitialDataToClient", null); + }, string.Format("SendInitialDataToClient ({0} in {1})", Name, Scene.Name), null); } /// -- cgit v1.1