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 commit is contained in:
BlueWall
2014-09-17 17:56:10 -04:00
parent 2d3072f053
commit af286d5fcb
5 changed files with 14 additions and 11 deletions

View File

@@ -677,7 +677,6 @@ 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)
@@ -691,6 +690,7 @@ 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.