As it is clear from the title
I want remove automatically threads from threads list when thread jobs done.
like:
Thread thr;
if(thr.done)
{
threadlist.remove(thr);
}
CodePudding user response:
If you check if the thread is finished with IsAlive and use Abort() to finish the thread...
if(!thr.IsAlive)
{
thr.Abort();
threadlist.remove(thr);
}