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).
This commit is contained in:
Justin Clark-Casey (justincc)
2014-09-05 23:20:59 +01:00
parent e4d16e6795
commit 41f2f3132b
12 changed files with 79 additions and 65 deletions

View File

@@ -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();
}
/// <summary>
/// Wrapper for Backup() that can be called with Util.RunThreadNoTimeout()
/// </summary>
private void BackupWaitCallback(object o)
{
Backup(false);
}
/// <summary>
/// Backup the scene.

View File

@@ -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);
}
/// <summary>