Yes, absolutely.
Thread.Abort() causes terrible, hard-to-reach errors, but ExitThread() does not.
Calling Thread.Abort() throws an exception to the thread inside the thread, which can cause all kinds of grief.
In addition, of course, ExitThread() only works with threads that run message loops.
Also note that the code after calling ExitThread() will still be executed, although UI calls like MessageBox.Show() will do nothing:
private void button1_Click(object sender, EventArgs e) { Application.ExitThread(); MessageBox.Show("This won't be shown because the UI is being shut down."); Debug.WriteLine("But this is still executed"); }
If you want to disable threads in a controlled manner, you need to actively support it by writing code for this.
Here is a good Microsoft article about this: http://msdn.microsoft.com/en-us/library/dd997364.aspx
source share