diff options
Diffstat (limited to 'ThirdParty/SmartThreadPool/STPStartInfo.cs')
-rw-r--r-- | ThirdParty/SmartThreadPool/STPStartInfo.cs | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/ThirdParty/SmartThreadPool/STPStartInfo.cs b/ThirdParty/SmartThreadPool/STPStartInfo.cs new file mode 100644 index 0000000..d181563 --- /dev/null +++ b/ThirdParty/SmartThreadPool/STPStartInfo.cs | |||
@@ -0,0 +1,99 @@ | |||
1 | // Ami Bar | ||
2 | // amibar@gmail.com | ||
3 | |||
4 | using System.Threading; | ||
5 | |||
6 | namespace Amib.Threading | ||
7 | { | ||
8 | /// <summary> | ||
9 | /// Summary description for STPStartInfo. | ||
10 | /// </summary> | ||
11 | public class STPStartInfo : WIGStartInfo | ||
12 | { | ||
13 | /// <summary> | ||
14 | /// Idle timeout in milliseconds. | ||
15 | /// If a thread is idle for _idleTimeout milliseconds then | ||
16 | /// it may quit. | ||
17 | /// </summary> | ||
18 | private int _idleTimeout; | ||
19 | |||
20 | /// <summary> | ||
21 | /// The lower limit of threads in the pool. | ||
22 | /// </summary> | ||
23 | private int _minWorkerThreads; | ||
24 | |||
25 | /// <summary> | ||
26 | /// The upper limit of threads in the pool. | ||
27 | /// </summary> | ||
28 | private int _maxWorkerThreads; | ||
29 | |||
30 | /// <summary> | ||
31 | /// The priority of the threads in the pool | ||
32 | /// </summary> | ||
33 | private ThreadPriority _threadPriority; | ||
34 | |||
35 | /// <summary> | ||
36 | /// If this field is not null then the performance counters are enabled | ||
37 | /// and use the string as the name of the instance. | ||
38 | /// </summary> | ||
39 | private string _pcInstanceName; | ||
40 | |||
41 | private int _stackSize; | ||
42 | |||
43 | public STPStartInfo() : base() | ||
44 | { | ||
45 | _idleTimeout = SmartThreadPool.DefaultIdleTimeout; | ||
46 | _minWorkerThreads = SmartThreadPool.DefaultMinWorkerThreads; | ||
47 | _maxWorkerThreads = SmartThreadPool.DefaultMaxWorkerThreads; | ||
48 | _threadPriority = SmartThreadPool.DefaultThreadPriority; | ||
49 | _pcInstanceName = SmartThreadPool.DefaultPerformanceCounterInstanceName; | ||
50 | _stackSize = SmartThreadPool.DefaultStackSize; | ||
51 | } | ||
52 | |||
53 | public STPStartInfo(STPStartInfo stpStartInfo) : base(stpStartInfo) | ||
54 | { | ||
55 | _idleTimeout = stpStartInfo._idleTimeout; | ||
56 | _minWorkerThreads = stpStartInfo._minWorkerThreads; | ||
57 | _maxWorkerThreads = stpStartInfo._maxWorkerThreads; | ||
58 | _threadPriority = stpStartInfo._threadPriority; | ||
59 | _pcInstanceName = stpStartInfo._pcInstanceName; | ||
60 | _stackSize = stpStartInfo._stackSize; | ||
61 | } | ||
62 | |||
63 | public int IdleTimeout | ||
64 | { | ||
65 | get { return _idleTimeout; } | ||
66 | set { _idleTimeout = value; } | ||
67 | } | ||
68 | |||
69 | public int MinWorkerThreads | ||
70 | { | ||
71 | get { return _minWorkerThreads; } | ||
72 | set { _minWorkerThreads = value; } | ||
73 | } | ||
74 | |||
75 | public int MaxWorkerThreads | ||
76 | { | ||
77 | get { return _maxWorkerThreads; } | ||
78 | set { _maxWorkerThreads = value; } | ||
79 | } | ||
80 | |||
81 | public ThreadPriority ThreadPriority | ||
82 | { | ||
83 | get { return _threadPriority; } | ||
84 | set { _threadPriority = value; } | ||
85 | } | ||
86 | |||
87 | public string PerformanceCounterInstanceName | ||
88 | { | ||
89 | get { return _pcInstanceName; } | ||
90 | set { _pcInstanceName = value; } | ||
91 | } | ||
92 | |||
93 | public int StackSize | ||
94 | { | ||
95 | get { return _stackSize; } | ||
96 | set { _stackSize = value; } | ||
97 | } | ||
98 | } | ||
99 | } | ||