Exemplo n.º 1
0
        public void ThreadedCompile(bool skipFinalization = false)
        {
            Setup();

            if (!CompilerSettings.MethodScanner)
            {
                ScheduleAll();
            }

            lock (_lock)
            {
                if (Stage != CompileStage.Ready)
                {
                    return;
                }

                Stage = CompileStage.Executing;
            }

            var maxThreads = CompilerSettings.MaxThreads != 0 ? CompilerSettings.MaxThreads : Environment.ProcessorCount;

            Compiler.ExecuteThreadedCompile(maxThreads);

            lock (_lock)
            {
                Stage = CompileStage.Ready;
            }

            if (!skipFinalization)
            {
                Finalization();
            }
        }
Exemplo n.º 2
0
 public void ExecuteThreaded()
 {
     Initialize();
     PreCompile();
     ScheduleAll();
     Compiler.ExecuteThreadedCompile(MaxThreads);
     PostCompile();
 }