[fpc-devel] threadvar vs docs
gabor
gabor at poczta.onet.pl
Fri Oct 18 15:46:40 CEST 2024
W dniu 2024-10-18 o 15:27, Nikolay Nikolov via fpc-devel pisze:
>
> In C (with gcc) it's possible to give them initial value, other than 0:
>
> __thread int i = 5;
>
> But it doesn't seem to be supported by FPC for threadvars. And I don't
> know about Delphi. FPC's thread initialization does indeed include code
> for copying the initial values, when creating a thread. Maybe it's for
> compatibility with thread-aware C libraries (including e.g. glibc),
> linked with the program, or for a possible future support for
> initialized threadvars in FPC?
>
> Nikolay
Maybe variables containing managed types, such as dynamic arrays could
be a problem in this case?
Michał
More information about the fpc-devel
mailing list