Example #1
0
        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;
        }
Example #2
0
 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;
 }