TThread.WaitFor

Waits for the thread to terminate and returns the exit status.

Declaration

Source position: classesh.inc line 1980

public 
  function WaitFor : Integer;

Description

WaitFor waits for the thread to terminate, and returns the exit status. Note that when executed in the main thread, this method calls CheckSynchronize , this is done to avoid deadlocks: if the thread is waiting for a synchronize , then the synchronize methods will be executed and then the WaitFor will return.

See also

Name Description
TThread.FreeOnTerminate Indicates whether the thread should free itself when it stops executing.
TThread.Synchronize Synchronizes the thread by executing the method in the main thread.
TThread.Terminated Indicates whether the Terminate method was called by the user.
TThread.WaitFor Waits for the thread to terminate and returns the exit status.