0
In most examples I found the structure of a basic Task is:
procedure
var
FTask : ITask;
begin
FTask := TTask.Run(
procedure
begin
//código a ser executado dentro da Task;
TThread.synchronize(TThread.CurrentThread,
procedure
begin
//Código que executa dentro da Thread principal;
end);
end;
);
end;
Where TThread.CurrentThread indicates which Thread the code will run on, but I have also seen examples of code where instead of TThread.CurrentThread is past nil, what’s the difference? How does it work? The OS will decide for itself which Thread will execute the code?
Got it, Thank you very much.
– Diego_F