RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TThread.AfterConstruction Method

Executes the thread when the thread is created with CreateSuspended set to false.

Pascal
procedure AfterConstruction; override;
C++
virtual __fastcall AfterConstruction();

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!