Mosa.Compiler.Framework.BaseCompiler.ExecuteThreadedCompilePass C# (CSharp) Method

ExecuteThreadedCompilePass() private method

private ExecuteThreadedCompilePass ( int threads ) : void
threads int
return void
        private void ExecuteThreadedCompilePass(int threads)
        {
            using (var finished = new CountdownEvent(1))
            {
                for (int threadID = 0; threadID < threads; threadID++)
                {
                    finished.AddCount();

                    int tid = threadID + 1;

                    ThreadPool.QueueUserWorkItem(
                        new WaitCallback(delegate
                        {
                            //try
                            //{
                            CompileWorker(tid);

                            //}
                            //catch (Exception e)
                            //{
                            //	this.CompilerTrace.NewCompilerTraceEvent(CompilerEvent.Exception, e.ToString(), threadID);
                            //}
                            //finally
                            //{
                            finished.Signal();

                            //}
                        }
                    ));
                }

                finished.Signal();
                finished.Wait();
            }
        }