How to add Sender parameter in thread onterminate?

0

I have a thread that executes an action and onterminate executes a secondary procedure.

It works like this:

procedure qualquer;
var
  Thread: TThread;
begin

  Thread.CreateAnonymousThread(
  procedure()
  begin

    excecuta ação  

  end;

  //como quero que fique - adicionando parametros
  Thread.OnTerminate:= concluiacao(parametro sender, outro parametro);

  //como faço
  Thread.OnTerminate:= concluiacao;

  Thread.Start;

end;  

Then I execute the second procedure

procedure concluiacao(Sender: TObject);
begin

  if TThread(Sender).FatalException <> nil then
  begin
    ShowMessage(TThread(Sender).FatalException.ToString);
    Exit;
  end
  else
    continua os processos normalmente;

end;

I would like to send new parameters in the onterminate of the thread, but the first parameter is a sender, and I do not know how to send it.

    
asked by anonymous 05.12.2018 / 13:00

0 answers