/// <summary> /// Run the first thread in the ThreadQueue /// </summary> private void RunThread(bool nullifyThreadInst = false) { ThreadQueue.Peek().IsBackground = true; ThreadQueue.Peek().Start(); runningThreads++; if (runningThreads >= 3) { ThreadQueue.Peek().Join(); runningThreads--; } ThreadingEventArgs removeArgs = new ThreadingEventArgs(); removeArgs.Thread = ThreadQueue.Peek(); ThreadQueue.Dequeue(); ItemRemovedFromThreadQueue(removeArgs); }