Abstract class to create separate threads of execution.
TThreadEx is EurekaLog's replacement for TThread class. TThreadEx offers two additional arguments in constructor, which allows you to control thread's name and EurekaLog's state in this thread.
Create a descendant of TThreadEx to represent an execution thread in a multithreaded application. Each new instance of a TThreadEx descendant is a new thread of execution. Multiple instances of a TThreadEx derived class make an application multithreaded.
When an application is run, it is loaded into memory ready for execution. At this point it becomes a process containing one or more threads that contain the data, code and other system resources for the program. A thread executes one part of an application and is allocated CPU time by the operating system. All threads of a process share the same address space and can access the process's global variables.
Define the thread object's Execute method by inserting the code that should execute when the thread is executed.
Threads launched with TThreadEx class will be EurekaLog-enabled by default. You can supply optional Boolean argument for TThreadEx's constructor to disable EurekaLog in thread, for example:
Of course, you can use the same approach while supplying Suspended argument, for example:
TThreadEx class also supports anonymous threads:
Since analyzing Thread.FatalException property or creating OnTerminate handler just for handling exceptions in thread is a lot of work - TThreadEx class presents a new property to handle exceptions automatically: