Exemple #1
0
        public bool start(ICommandPool commandPool, ICompileNotifier notifier)
        {
            if (isRunning())
            {
                return(false);
            }

            setRunning(true);

            m_forcingStop = false;
            m_commandPool = commandPool;
            m_notifier    = notifier;

            m_thread = new Thread(m_threadStart);
            m_thread.Start();

            return(true);
        }
        public bool compile(List <TCommand> commands, int jobs, ICompileNotifier notifier)
        {
            if (isRunning())
            {
                return(false);
            }
            setRunning(true);

            m_curCmdIdx = 0;
            m_commands  = commands;

            m_jobs = jobs;
            if (m_jobs < 1)
            {
                m_jobs = 1;
            }
            if (m_jobs > s_kMaxJobs)
            {
                m_jobs = s_kMaxJobs;
            }

            for (int i = 0; i < jobs; i++)
            {
                m_compileThreads[i].start(this, notifier);
            }

            for (int i = 0; i < jobs; i++)
            {
                m_compileThreads[i].join();
            }

            m_agent.signalToStopAllSessions();             // just disconnect all remotes' connections

            setRunning(false);
            return(true);
        }