private void QProcess(string name, Func <Process> createProcess, bool highPriority) { if (!_cont) { throw new InvalidOperationException("The queue is not running, unable to queue item."); } _toProcess.Add(createProcess(), highPriority); _tasksQueued++; Util.Wake(WorkQueued); if (!_paused && ItemsPerThread > 0 && ThreadCount * ItemsPerThread < EventCount) { var extraEventThread = new Thread(extraEventThreadMethod); extraEventThread.Name = "Extra " + _name + " " + (ThreadCount + 1); extraEventThread.Start(); _threads.Add(extraEventThread); _threadTasks[extraEventThread.Name] = "Startup"; } }