On Thu, 16 Mar 2017, African Wild Dog wrote:

I have a class where its instances are shared between multiple threads.
How can I declare one variable per instance per thread?

The code below does not compile (fpc 3.0.0):

TMyClass = class
public
 threadvar MyValue: Integer;
end;

This is not foreseen as a language construct, you must do this yourself.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to