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 ThreadPool(int maxThreads, bool useFXThreadPool)
        {
            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;
        }
Example #3
0
 public CounterToken(WaitableCounter parent, int index)
 {
     this.parent = parent;
     this.index = index;
 }
 public CounterToken(WaitableCounter parent, int index)
 {
     this.parent = parent;
     this.index  = index;
 }