System.Classes.TThread.AfterConstruction
Delphi
procedure AfterConstruction; override;
C++
virtual void __fastcall AfterConstruction(void);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Classes.pas System.Classes.hpp |
System.Classes | TThread |
Description
Executes the thread when the thread is created with CreateSuspended set to false.
AfterConstruction launches the Execute method when the thread is not created in a suspended state. By calling Execute from the AfterConstruction method rather than the constructor, TThread avoids a race condition where the thread may free itself after Execute finishes but before the main thread calls AfterConstruction.