public ThreadPool(int maxThreads, bool useFXThreadPool) { if (maxThreads < MinimumCount || maxThreads > MaximumCount) { throw new ArgumentOutOfRangeException("maxThreads", "must be between " + MinimumCount.ToString() + " and " + MaximumCount.ToString() + " inclusive"); } Counter = new WaitableCounter(maxThreads); UseFXThreadPool = useFXThreadPool; }
public PrivateThreadPool(int maxThreads, bool useFXThreadPool) { this.exceptions = ArrayList.Synchronized(new ArrayList()); if ((maxThreads < MinimumCount) || (maxThreads > MaximumCount)) { throw new ArgumentOutOfRangeException("maxThreads", "must be between " + MinimumCount.ToString() + " and " + MaximumCount.ToString() + " inclusive"); } this.counter = new WaitableCounter(maxThreads); this.useFXTheadPool = useFXThreadPool; }