Revert "Small changes to threading to send thread names to unmanaged threads. Needs Mono 3.6+ to see thread names in utilities like top -H . Some formatting of the thread name to fin in the 16 byte limit on Linux. Please test on Windows to see if the work has any adverse effects."

This reverts commit af286d5fcb.
Issue with Jenkins builds
mb-throttle-test
BlueWall 2014-09-17 18:11:41 -04:00
parent af286d5fcb
commit 376fab1402
5 changed files with 11 additions and 14 deletions

View File

@ -87,7 +87,7 @@ namespace OpenSim.Framework.Monitoring
/// </summary>
public Stat Stat { get; set; }
public ThreadWatchdogInfo(Thread thread, int timeout, string name)
public ThreadWatchdogInfo(Thread thread, int timeout)
{
Thread = thread;
Timeout = timeout;
@ -96,8 +96,8 @@ namespace OpenSim.Framework.Monitoring
Stat
= new Stat(
name,
string.Format("Last update of thread {0}", name),
thread.Name,
string.Format("Last update of thread {0}", thread.Name),
"",
"ms",
"server",
@ -216,11 +216,12 @@ namespace OpenSim.Framework.Monitoring
bool alarmIfTimeout, Func<string> alarmMethod, int timeout, bool log = true)
{
Thread thread = new Thread(start);
thread.Name = name;
thread.Priority = priority;
thread.IsBackground = isBackground;
ThreadWatchdogInfo twi
= new ThreadWatchdogInfo(thread, timeout, name)
= new ThreadWatchdogInfo(thread, timeout)
{ AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod };
if (log)
@ -229,10 +230,8 @@ namespace OpenSim.Framework.Monitoring
lock (m_threads)
m_threads.Add(twi.Thread.ManagedThreadId, twi);
thread.Start();
thread.Name = name;
thread.Start();
return thread;
}

View File

@ -70,9 +70,9 @@ namespace OpenSim.Framework.Servers.HttpServer
_id = id;
_engine = new Thread(new ThreadStart(Engine));
_engine.Name = EngineID;
_engine.IsBackground = true;
_engine.Start();
_engine.Name = string.Format ("Engine:{0}",EngineID);
ThreadTracker.Add(_engine);
}
@ -91,9 +91,9 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Start()
{
_engine = new Thread(new ThreadStart(Engine));
_engine.Name = EngineID;
_engine.IsBackground = true;
_engine.Start();
_engine.Name = string.Format ("Engine:{0}",EngineID);
ThreadTracker.Add(_engine);
}

View File

@ -150,9 +150,9 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Start()
{
_engine = new Thread(new ThreadStart(Engine));
_engine.Name = _engineId;
_engine.IsBackground = true;
_engine.Start();
_engine.Name = string.Format ("Engine:{0}",_engineId);
ThreadTracker.Add(_engine);

View File

@ -1079,8 +1079,6 @@ namespace OpenSim.Region.Framework.Scenes
StatsReporter = new SimStatsReporter(this);
StatsReporter.OnSendStatsResult += SendSimStatsPackets;
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
Thread.CurrentThread.Name = string.Format ("Scene:{0}", regInfo.RegionName.Replace(" ", "_"));
}
public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo)
@ -1398,7 +1396,7 @@ namespace OpenSim.Region.Framework.Scenes
m_heartbeatThread
= Watchdog.StartThread(
Heartbeat, string.Format("Heartbeat-({0})", RegionInfo.RegionName.Replace(" ", "_")), ThreadPriority.Normal, false, false);
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
StartScripts();
}

View File

@ -677,6 +677,7 @@ namespace Amib.Threading
: new Thread(ProcessQueuedItems);
#endif
// Configure the new thread and start it
workerThread.Name = "STP " + Name + " Thread #" + _threadCounter;
workerThread.IsBackground = _stpStartInfo.AreThreadsBackground;
#if !(_SILVERLIGHT) && !(_WINDOWS_CE) && !(WINDOWS_PHONE)
@ -690,7 +691,6 @@ namespace Amib.Threading
workerThread.Priority = _stpStartInfo.ThreadPriority;
#endif
workerThread.Start();
workerThread.Name = string.Format("STP:{0}:{1}", Name, _threadCounter);
++_threadCounter;
// Add it to the dictionary and update its creation time.