Topic Path: Symbol Reference > Classes > TIdThread Class > TIdThread Methods > Terminate Method
ContentsIndexHome
PreviousUpNext
TIdThread.Terminate Method

Forces the thread of execution to be halted.

procedure Terminate; virtual;

Terminate is a procedure in TIdThread that forces the thread of execution to be halted. Calling Terminate causes both the Stopped and Terminated properties to be set to True. Terminate uses an internal critical section to protect access to member variables and calls to the inherited Terminate method. 

Terminate will be called in Execute when an exception is raised during execution of the thread. Terminate is also called when Stop is executed and StopMode contains smTerminate. 

Use TerminateAndWaitFor to halt a thread that may not currently be executing, but should restart the thread and allow it to run to completion.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.