TThread's statement in the classes unit is as follows
Type TThread = Class private fhandle:thandle; Fthreadid:thandle; Fterminated:boolean; Fsuspended:boolean; Ffreeonterminate:boolean; Ffinished:boolean; Freturnvalue:integer; Fonterminate:tnotifyevent; Fmethod:tthreadmethod; Fsynchronizeexception:tobject; Procedure Callonterminate; function getpriority:tthreadpriority; Procedure setpriority (value:tthreadpriority); Procedure setsuspended (Value:boolean); protected procedure Doterminate; Virtual Procedure Execute; Virtual Abstract Procedure Synchronize (Method:tthreadmethod); Property Returnvalue:integer read Freturnvalue write Freturnvalue; Property Terminated:boolean read fterminated; Public constructor Create (Createsuspended:boolean); destructor Destroy; Override Procedure Resume; Procedure Terminate; function Waitfor:integer; PropeRty Freeonterminate:boolean Read Ffreeonterminate write ffreeonterminate; Property Handle:thandle read Fhandle; Property priority:tthreadpriority read GetPriority write setpriority; Property Suspended:boolean read fsuspended write Suspended; Property Threadid:thandle read Fthreadid; Property Onterminate:tnotifyevent read Fonterminate write fonterminate; End
When TThread's Create () is called, it is necessary to pass a Boolean parameter createsuspended. If this parameter is set to False, execute () is automatically called when Create () is called, which is the thread code that executes automatically. If this parameter is set to True, you need to run TThread's resume () to wake the thread.
In general, when you call Create (), there are some additional property requirements to set. Therefore, you should set the createsuspended parameter to true, because setting the TThread property in TThread has been performed can cause trouble.
At a deeper point, a RTL routine beginthread () is implicitly called in the constructor Create (), and it calls an API function CreateThread () to create an instance of a thread object. The createsuspended parameter indicates whether the CREATE_SUSPENDED flag is passed to CreateThread ().
Introduction to Delphi Threading and its Create method