I created a general thread class that controls the execution form, which is entered into the stream constructor and set as _progressForm
. In the Execute method, the stream initializes the form and displays it using the ShowModal () function, as shown below:
procedure TProgressThread.Execute;
begin
...
ShowForm;
end;
procedure TProgressThread.ShowForm;
begin
if Assigned(_progressForm) then
begin
Synchronize(
procedure
begin
_progressForm.ShowModal();
end);
end;
end;
What I cannot understand, why is my thread blocked in Synchronize? He does not return until the form of progress is closed. Should ShowModal block the main thread?
source
share