Question

Since C++ Builder 2010 does not seem to include the CheckTerminated() function on TThread I added my own to a thread I needed to check the status of from outside the thread.

This works fine, but I'm trying to find information as to whether or not letting the Exectue() function of the thread finish sets the Terminated property to true or if I manually have to do that at the end of the Execute() method, alternatively run Terminate() at the end of the Execute() method.

Was it helpful?

Solution

Set FreeOnTerminate to false and read Finished propery to find out if Execute() function has been finished.

if(myThread->Finished)
{
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top