Skip to Main Content
Delphi High Performance
book

Delphi High Performance

by Primož Gabrijelčič
February 2018
Intermediate to advanced content levelIntermediate to advanced
336 pages
7h 52m
English
Packt Publishing
Content preview from Delphi High Performance

Advanced TThread

The TThread class offers the programmer a collection of various properties and methods. In this section, I'll take you through the most useful ones.

The FatalException property deals with exceptions. If an exception arises inside your Execute method and is not caught, it will be handled inside the system code:

if not Thread.Terminated thentry  Thread.Execute;except  Thread.FFatalException := AcquireExceptionObject;end;

The best place to check whether this property is assigned is the OnTerminate handler. If the FatalException is not nil, we can log the exception and call ReleaseExceptionObject to destroy the exception object or we can reraise the exception. The following code from the Threads demo shows how to implement such ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi Cookbook

Delphi Cookbook

Daniele Teti

Publisher Resources

ISBN: 9781788625456Supplemental Content