diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index d1a74ce70a..a7a03a0c13 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs @@ -121,7 +121,8 @@ namespace OpenSim.Framework.Monitoring Thread thread = new Thread(start); thread.Priority = priority; thread.IsBackground = isBackground; - + thread.Name = name; + Watchdog.ThreadWatchdogInfo twi = new Watchdog.ThreadWatchdogInfo(thread, timeout, name) { AlarmIfTimeout = alarmIfTimeout, AlarmMethod = alarmMethod }; @@ -129,7 +130,7 @@ namespace OpenSim.Framework.Monitoring Watchdog.AddThread(twi, name, log:log); thread.Start(); - thread.Name = name; + return thread; } diff --git a/ThirdParty/SmartThreadPool/SmartThreadPool.cs b/ThirdParty/SmartThreadPool/SmartThreadPool.cs index 615518ecf1..9043d3a1bb 100644 --- a/ThirdParty/SmartThreadPool/SmartThreadPool.cs +++ b/ThirdParty/SmartThreadPool/SmartThreadPool.cs @@ -689,9 +689,10 @@ namespace Amib.Threading #if !(_SILVERLIGHT) && !(WINDOWS_PHONE) workerThread.Priority = _stpStartInfo.ThreadPriority; #endif - workerThread.Start(); workerThread.Name = string.Format("STP:{0}:{1}", Name, _threadCounter); - ++_threadCounter; + workerThread.Start(); + + ++_threadCounter; // Add it to the dictionary and update its creation time. _workerThreads[workerThread] = new ThreadEntry(this);