comparison ThreadPool.cs @ 102:1474f92cf7e7

Regression fix in ThreadPool class
author Ivo Smits <Ivo@UCIS.nl>
date Wed, 01 Oct 2014 23:16:06 +0200
parents 4b78cc5f116b
children
comparison
equal deleted inserted replaced
101:04c56f31db37 102:1474f92cf7e7
110 get { return pThreadsMaxIdle; } 110 get { return pThreadsMaxIdle; }
111 set { 111 set {
112 if (pThreadsMinIdle > value) throw new ArgumentOutOfRangeException("ThreadsMaxIdle", "ThreadsMaxIdle must be greater than or equal to ThreadsMinIdle"); 112 if (pThreadsMinIdle > value) throw new ArgumentOutOfRangeException("ThreadsMaxIdle", "ThreadsMaxIdle must be greater than or equal to ThreadsMinIdle");
113 if (value < 0) throw new ArgumentOutOfRangeException("ThreadsMaxIdle", "ThreadsMaxIdle must greater than or equal to 0"); 113 if (value < 0) throw new ArgumentOutOfRangeException("ThreadsMaxIdle", "ThreadsMaxIdle must greater than or equal to 0");
114 lock (pIdleThreads) { 114 lock (pIdleThreads) {
115 while (value > pIdleThreads.Count) { 115 while (value < pIdleThreads.Count) {
116 ThreadInfo T = pIdleThreads.Dequeue(); 116 ThreadInfo T = pIdleThreads.Dequeue();
117 T.Abort = true; 117 T.Abort = true;
118 T.WaitHandle.Set(); 118 T.WaitHandle.Set();
119 } 119 }
120 } 120 }