Thread.Abort() not immedate (WebClient) c#

时间:2015-05-26 18:37:33

标签: c# multithreading webclient

I have a piece of code which closes all the threads in a thread list:

for (int i = 0; i < ThreadList.Count - 1; i++)
{
    ThreadList[i].Abort();
}

The issue is that inside the thread code there is a webclient piece of code which can take a while to complete. I realized that I cannot close threads which have running code inside, but if that is the case, how can I close the threads?

0 个答案:

没有答案