RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TThread.WaitFor Method

Waits for the thread to terminate and then returns the value of the ReturnValue property.

Pascal
function WaitFor: LongWord;
C++
__fastcall LongWord WaitFor();

Call WaitFor to obtain the value of ReturnValue when the thread finishes executing. WaitFor doesn't return until the thread terminates, so the thread must exit either by finishing the Execute method or by exiting when the Terminated property is true. 

 

TThread 

Execute 

ReturnValue 

Synchronize 

Waiting for a Thread to Finish Executing

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