private void ThreadFunc() { while (true) { if (Globals.Pause) { //This is ass backwards and overkill. Too lazy to fix at the moment CheckForIllegalCrossThreadCalls = false; Application.DoEvents(); Thread.Sleep(1); continue; } Thread.Sleep(1); var uri = ThreadPool.Dequeue(); ProcessSearch(uri); } // ReSharper disable FunctionNeverReturns }
public ThreadPoolTask Dequeue() { return(pool.Dequeue()); }