HikariThreading.ThreadManager.HandleDedicatedThreads C# (CSharp) Method

HandleDedicatedThreads() private method

Checks if any dedicated threads are finished, and if so adds them to the larger pool.
private HandleDedicatedThreads ( ) : void
return void
        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;
                }
            }
        }