コード例 #1
0
        static public ThreadExecutor GetThread(bool Create = false)
        {
            ThreadExecutor Selected = null;

            lock (Executors)
            {
                if (Create == false)
                {
                    foreach (ThreadExecutor Executor in Executors)
                    {
                        if (Executor.Processing)
                        {
                            continue;
                        }

                        Selected = Executor;
                        break;
                    }
                }
                else
                {
                    Selected = CreateThread();
                }
            }

            return(Selected);
        }
コード例 #2
0
        static public ThreadExecutor CreateThread()
        {
            ThreadExecutor Executor = new ThreadExecutor(Executors.Count);

            Executors.Add(Executor);
            return(Executor);
        }
コード例 #3
0
        static public void Start(int StartThreadCount, int WaitTimeMS)
        {
            ThreadExecutor.MainExecutor = new ThreadExecutor(-1);
            ThreadExecutor.WaitTimeMS   = WaitTimeMS;

            for (int i = 0; i < StartThreadCount; ++i)
            {
                CreateThread();
            }
        }
コード例 #4
0
 public static ThreadExecutor CreateThread()
 {
     ThreadExecutor Executor = new ThreadExecutor(Executors.Count);
     Executors.Add(Executor);
     return Executor;
 }
コード例 #5
0
        public static void Start(int StartThreadCount, int WaitTimeMS)
        {
            ThreadExecutor.MainExecutor = new ThreadExecutor(-1);
            ThreadExecutor.WaitTimeMS = WaitTimeMS;

            for (int i = 0; i < StartThreadCount; ++i)
                CreateThread();
        }