On Mon, 25 Apr 2022 15:47:57 +0200
Thomas Kurz via fpc-pascal <[email protected]> wrote:
>[...]
> As far as I have seen so far, the common solution is to use a
> variable inside the class to cache the parameters, then to use a
> DoCallSync procedure which takes no parameters but can use the cached
> values inside, and finally to call TThread.Synchronize(NIL,
> @DoCallSync). I have stick to this concept when using Synchronize,
> too.
Or some small class:
type
TMyData = class
a: whatever;
procedure Run;
end;
MyData:=TMyData.Create;
MyData.a:=...;
TThread.Synchronize(NIL, @MyData.Run).
Free MyData when done and/or in the destructor.
>[...]
Mattias
_______________________________________________
fpc-pascal maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal