private void HandleDedicatedThreads( )
{
lock ( threadLock )
{
List<Thread> finishedThreads = new List<Thread>();
// Find the finished ones
foreach ( Thread t in dedicatedThreads )
{
if ( !t.Running )
finishedThreads.Add(t);
}
// Move to finished ones
foreach ( Thread t in finishedThreads )
{
dedicatedThreads.Remove(t);
threads.Add(t);
numThreads++;
// Treat it as a thread spawn since it is essentially a new
// thread for the manager.
lastThreadSpawn = DateTime.Now;
}
}
}