Much thanks Sven! I'm note sure when I'll use it, but the option is always
nice to have. A small question, since it's available in a class, does
"class threadvar" support generics?

{$mode delphi}

type
  TAnimal<T: TTrainer> = class
  public class threadvar Trainer: T;
  end;

For everyone else, threadvar is the language integrated simplification
of thread
local storage <https://en.wikipedia.org/wiki/Thread-local_storage>.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to