Hi,
I develop multi thread application to doing some jobs, below is my execute function of threads.
procedure TTaskRunner.Execute;
begin
Synchronize(@OnStart);
FTask.Execute;
Synchronize(@OnFinish);
end;
I some state like StopButtonClick I have forced threads to stop and using KillThread to do this but some times killthread cause exception for example in OnFinish line (Synchronize(@OnFinish); ).
Is there way to handle force stop exceptions or this better way to stop threads ?!
for more information I can't using terminate because my thread don't use infinity while or other loop to check Terminated and exit Execute function.
I using Linux(Manjaro 64) and FPC trunk.