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