예제 #1
0
        protected override void OnDoWork(DoWorkEventArgs e)
        {
            WorkerSupportsCancellation = true;
            this.WorkerReportsProgress = true;

            base.OnDoWork(e);

            _stepInProgress.Clear();
            _threadPool = new ThreadPool(ThreadCounts, ThreadCounts);

            if (e.Argument is Step[])
            {
                var steps = (Step[])e.Argument;
                steps.ForEach(FindSolution);
            }
            else
            {
                FindSolution(e.Argument);
            }

            do
            {
                Thread.Sleep(3000);
                ClearFinished();
            } while (_stepInProgress.Count > 0);
            _threadPool.Close();
        }
예제 #2
0
 protected override void OnStartBuild()
 {
     _threadPool = new ThreadPool(ThreadCounts, ThreadCounts);
 }