SomeGuyThatIsMe is right. As you can read on the
MSDN documentation about
Thread.Abort Method (System.Threading)[
^]:
"When this method is invoked on a thread, the system throws a
ThreadAbortException
in the thread to abort it.
ThreadAbortException
is a special exception that can be caught by application code, but is re-thrown at the end of the catch block unless
ResetAbort
is called. ResetAbort cancels the request to abort, and prevents the ThreadAbortException from terminating the thread. Unexecuted finally blocks are executed before the thread is aborted."
This will give the thread a chance to cleanup the resources that it could have allocated, and to reject the request to abort.
If you don't need any cleanup, simply wrap your thread method inside a
try
/
catch
block.