mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
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:
@@ -2399,36 +2399,6 @@ namespace OpenSim.Framework
|
||||
|
||||
#endregion FireAndForget Threading Pattern
|
||||
|
||||
/// <summary>
|
||||
/// Run the callback on a different thread, outside the thread pool. This is used for tasks
|
||||
/// that may take a long time.
|
||||
/// </summary>
|
||||
public static void RunThreadNoTimeout(WaitCallback callback, string name, object obj)
|
||||
{
|
||||
if (FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
|
||||
{
|
||||
Culture.SetCurrentCulture();
|
||||
callback(obj);
|
||||
return;
|
||||
}
|
||||
|
||||
Thread t = new Thread(delegate()
|
||||
{
|
||||
try
|
||||
{
|
||||
Culture.SetCurrentCulture();
|
||||
callback(obj);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("Exception in thread " + name, e);
|
||||
}
|
||||
});
|
||||
|
||||
t.Name = name;
|
||||
t.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
|
||||
/// and negative every 24.9 days. This trims down TickCount so it doesn't wrap
|
||||
|
||||
Reference in New Issue
Block a user