System.Threading.TThreadPool.TBaseWorkerThread.Execute

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Execute; override;

C++

virtual void __fastcall Execute();

Properties

Type Visibility Source Unit Parent
procedure
function
protected
System.Threading.pas
System.Threading.hpp
System.Threading TBaseWorkerThread

Description

Provides an abstract or pure virtual method to contain the code which executes when the thread is run.

System.Threading.TThreadPool.TBaseWorkerThread.Execute inherits from System.Classes.TThread.Execute. All content below this line refers to System.Classes.TThread.Execute.

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


Code Examples