I have a thread class that goes through all the files on a drive, and calls synchronize to feed information back to the VCL thread. It works fine.
Now, I want to launch several of these threads in sequence, and still have the GUI being responsive. "In sequence" meaning that the nest thread should not start
until the previous thread has finished
It is the WaitUntilFinished bit that has me confused. I tried setting a flag in OnTerminate and checking that in a loop with sleep and application.processMessages - bad news, unresponsive GUI.
Then I tried TThread.WaitFor .. same story
then I tried WaitForSingleObject (between the calls to ThreadedProcessDrive) .. same story.
hmmm .. do I need a supervisor thread that creates the others and resumes them ?
seems like a thread too many