System.Classes.TThread.Execute
Delphi
procedure Execute; virtual; abstract;
C++
virtual void __fastcall Execute() = 0 ;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | System.Classes.pas System.Classes.hpp |
System.Classes | TThread |
Description
Provides an abstract or pure virtual method to contain the code which executes when the thread is run.
Override Execute and insert the code that should be executed when the thread runs. Execute is responsible for checking the value of the Terminated property to determine if the thread needs to exit.
A thread executes when Create is called if CreateSuspended set to false, or when Resume is first called after the thread is created if CreateSuspended set to true.
Note: Do not use the properties and methods of other objects directly in the Execute method of a thread. Instead, separate the use of other objects into a separate procedure call, and call that procedure by passing it as a parameter to the Synchronize method.
See Also