https://wiki.freepascal.org/Threadvar
If threads are used then a copy is made for each thread (including the main thread). Note that the copy is made with the original value of the variable, not with the value of the variable at the time the thread is started.
But what is that original value? Since threadvar foo: integer = 1; gives Error: Cannot initialize variables declared as threadvar _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel