How to kill a thread in delphi? TMyThread Execute
procedure TMyThread.Execute;
begin
while not Terminated do begin
//Here you do a chunk of your work.
//It's important to have chunks small enough so that "while not Terminated"
//gets checked often enough.
end;
//Here you finalize everything before thread terminates
end;
With this, you can call
MyThread.Terminate;There is another method, called 'forced termination'. You can call
TerminateThread(MyThread.ThreadId);
Friday, January 21, 2011
Unknown


0 comments:
Post a Comment