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); }
static public ThreadExecutor CreateThread() { ThreadExecutor Executor = new ThreadExecutor(Executors.Count); Executors.Add(Executor); return(Executor); }
static public void Start(int StartThreadCount, int WaitTimeMS) { ThreadExecutor.MainExecutor = new ThreadExecutor(-1); ThreadExecutor.WaitTimeMS = WaitTimeMS; for (int i = 0; i < StartThreadCount; ++i) { CreateThread(); } }
public static ThreadExecutor CreateThread() { ThreadExecutor Executor = new ThreadExecutor(Executors.Count); Executors.Add(Executor); return Executor; }
public static void Start(int StartThreadCount, int WaitTimeMS) { ThreadExecutor.MainExecutor = new ThreadExecutor(-1); ThreadExecutor.WaitTimeMS = WaitTimeMS; for (int i = 0; i < StartThreadCount; ++i) CreateThread(); }