From b77da5039eba6db0f904bfa9ca0852d640436055 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Fri, 4 Jan 2013 08:43:05 +0200
Subject: Assign the SmartThreadPool name in the constructor
This is required because some threads are created in the constructor, so assigning the name afterwards would be too late.
---
ThirdParty/SmartThreadPool/STPStartInfo.cs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'ThirdParty/SmartThreadPool/STPStartInfo.cs')
diff --git a/ThirdParty/SmartThreadPool/STPStartInfo.cs b/ThirdParty/SmartThreadPool/STPStartInfo.cs
index d181563..fa9ceb4 100644
--- a/ThirdParty/SmartThreadPool/STPStartInfo.cs
+++ b/ThirdParty/SmartThreadPool/STPStartInfo.cs
@@ -33,6 +33,11 @@ namespace Amib.Threading
private ThreadPriority _threadPriority;
///
+ /// The thread pool name. Threads will get names depending on this.
+ ///
+ private string _threadPoolName;
+
+ ///
/// If this field is not null then the performance counters are enabled
/// and use the string as the name of the instance.
///
@@ -46,6 +51,7 @@ namespace Amib.Threading
_minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads;
_maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads;
_threadPriority = SmartThreadPool.DefaultThreadPriority;
+ _threadPoolName = SmartThreadPool.DefaultThreadPoolName;
_pcInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName;
_stackSize = SmartThreadPool.DefaultStackSize;
}
@@ -56,6 +62,7 @@ namespace Amib.Threading
_minWorkerThreads = stpStartInfo._minWorkerThreads;
_maxWorkerThreads = stpStartInfo._maxWorkerThreads;
_threadPriority = stpStartInfo._threadPriority;
+ _threadPoolName = stpStartInfo._threadPoolName;
_pcInstanceName = stpStartInfo._pcInstanceName;
_stackSize = stpStartInfo._stackSize;
}
@@ -84,6 +91,13 @@ namespace Amib.Threading
set { _threadPriority = value; }
}
+ public virtual string ThreadPoolName
+ {
+ get { return _threadPoolName; }
+ set { _threadPoolName = value; }
+ }
+
+
public string PerformanceCounterInstanceName
{
get { return _pcInstanceName; }
--
cgit v1.1