Threading Exceptions

Exceptions need to be dealt with appropriately in order to avoid threads terminating prematurely. Any exception within a thread that is not handled will cause the thread to be terminated. Therefore, it is a good programming practice to at least report all exceptions and handle those exceptions that are expected.

System.Threading.ThreadAbortException

Calling the Thread.Abort() method will raise the ThreadAbortException on the target thread. Normally, this will cause the thread to terminate. However, a thread can catch the ThreadAbortException and choose to ignore it by using the Thread.ResetAbort() method.

There are two overloaded Abort() methods. One method does not take any parameters; the other takes a System.Object that ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.