title: Stop thread immediately
body: <p>I have a long running task in a thread. I</p>
  
  <pre><code>Thread a = new Thread(new ThreadStart()({ delegate()
  {
     Catalog.Generate(); //long running task
  }));
  a.Start();
  
  Thread b = new Thread(new ThreadStart()({ delegate()
  {
     if( File.Exists(stopFile) )
     {
         a.Abort();
      }
  }));
  b.Start();
  </code></pre>
  
  <p>This stops Thread A when the stop file is created BUT the catalog.generate method still keeps running? How do I end it?</p>