Thread.Abort() : Thread « System.Threading « C# / C Sharp by API






Thread.Abort()

  

using System;
using System.Threading;

class MainClass
{
  static int MyCount = 0;
  static void Main(string[] args)
  {
    MyClassThread me = new MyClassThread();
    Thread MyNewThread = new Thread(new ThreadStart(me.MyThread));

    MyNewThread.Start();
    if (MyCount == 0)
      MyNewThread.Abort();
  }
}

class MyClassThread
{
  public void MyThread()
  {
  }
}

   
    
  








Related examples in the same category

1.new Thread()
2.Thread.AllocateDataSlot
3.Thread.AllocateNamedDataSlot
4.Thread.CurrentContext
5.Thread.CurrentCulture
6.Thread.CurrentThread
7.Thread.GetData
8.Thread.GetHashCode()
9.Thread.Interrupt()
10.Thread.IsAlive
11.Thread.IsBackground
12.Thread.Join()
13.Thread.Priority
14.Thread.ResetAbort()
15.Thread.SetData
16.Thread.Sleep
17.Thread.Start
18.Thread.ThreadState