First of all change the order of lines 25-26
inherited Create(False); FreeOnTerminate := True; instead of FreeOnTerminate := True; inherited Create(False); The, drop the DoExecute procedure and replace it by the Execute procedure. It is useless to Synchronize a thread's procedure inside itself ! After the creation, the thread executes immediately the overriden procedure Execute because, at creation time (inherited Create(False); ) the thread is created in the state NON SUSPENDED. The use of the DoExecute is obviously useless our program will execute the procedure Excute only once as there is no loop.
|
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal