src/concurrent/dotnet/ThreadPool.cs
/// <summary>
/// Unorderly shutdown of threads.  All pending work are discarded,
/// and interrupt is sent to each thread.
/// </summary>
Unorderly shutdown of threads.  All pending work are discarded,
and interrupt is sent to each thread.
Unorderly shutdown of threads . All pending work are discarded and interrupt is sent to each thread .
[MethodImpl(MethodImplOptions.Synchronized)]
    public void kill()
    {
      state = STOPPING;
      while (true)
      {
        LinkedListNode<Work> node = pending.First;
        if (node == null) break;
        Work work = (Work)node.Value;
        pending.RemoveFirst();
        work._kill();
      }
      IEnumerator en = workers.Values.GetEnumerator();
      while (en.MoveNext()) ((Worker)en.Current).thread.Interrupt();
    }
[ MethodImpl ( MethodImplOptions . Synchronized ) ] public void kill ( ) { state = STOPPING ; while ( true ) { LinkedListNode < Work > node = pending . First ; if ( node == null ) break ; Work work = ( Work ) node . Value ; pending . RemoveFirst ( ) ; work . _kill ( ) ; } IEnumerator en = workers . Values . GetEnumerator ( ) ; while ( en . MoveNext ( ) ) ( ( Worker ) en . Current ) . thread . Interrupt ( ) ; }
Unorderly shutdown of threads.
Unorderly shutdown of threads .
// kill all the pending work // interupt each thread