private void ThreadProc() { while (true) { DownloadTask task = null; if (m_taskQueue.TryDequeue(out task)) { task.BeginDownload(); } else { break; } } }
void DownloadThreadProc() { while (true) { DownloadTask task = null; if (_taskQueue.TryDequeue(out task)) { task.BeginDownload(); } else { break; } } lock (_obj) { _overThreadNum++; } }