procedure TThread.Terminate;
begin
  FTerminated := True;
end;

Should that not in some way deal with memory barriers? E.g. InterlockedExchange or similar?

And the same for the "Terminated" property, should that have a getter to do the same?

As it stands, afaik a thread could get the "Terminate" flag with an unknown delay?

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to