src/concurrent/dotnet/ThreadPool.cs
/// <summary>
/// Orderly shutdown of threads.  All pending work items are processed.
/// </summary>
Orderly shutdown of threads.  All pending work items are processed.
Orderly shutdown of threads . All pending work items are processed .
[MethodImpl(MethodImplOptions.Synchronized)]
    public void stop()
    {
      state = STOPPING;
      while (true)
      {
        LinkedListNode<Worker> node = idle.First;
        if (node == null) break;
        Worker w = (Worker)node.Value;
        idle.RemoveFirst();
        w.run(null);
      }
    }
[ MethodImpl ( MethodImplOptions . Synchronized ) ] public void stop ( ) { state = STOPPING ; while ( true ) { LinkedListNode < Worker > node = idle . First ; if ( node == null ) break ; Worker w = ( Worker ) node . Value ; idle . RemoveFirst ( ) ; w . run ( null ) ; } }
Orderly shutdown of threads.
Orderly shutdown of threads .
// immediately wake up all the idle workers so they can die