El 12/1/21 a les 10:24, Michael Van Canneyt via fpc-pascal ha escrit:


Am I right thinking that, even if several copies of the above method are running, each will get it's own local variables, so the LocCommandQueue variable (as well as the other locals) won't be clobbered by another copy?
Or should I declare them as threadvar?

If FCommandQueue is the only thing that is set during SyncNewConnection
based on TRequest, then yes.

yes to "each will get its [*] own local" or yes to "should I declare them as threadvar"?

For safety, I would Nil the FCommandQueue after
assigning it to locCommandQueue.

No need, it's only used as a return value from the synchronized method.

[*] sorry for the "it's" in the original sentence

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

Reply via email to