Member variables in method are null when called as delegate from thread

Imperatorn johan_forsberg_86 at hotmail.com
Tue Jan 12 09:19:14 UTC 2021


On Monday, 11 January 2021 at 17:26:00 UTC, Arafel wrote:

> void f() {
>     assert(i == 0); // Expected
>     assert(j == 1); // Expected
>     assert(s.i == 0); // Expected
>     assert(s.j == 0); // Wait, what?
> }

At first sight this looks unexpected. But I think if you have a 
shared variable inside a struct it will not be TLS.


More information about the Digitalmars-d-learn mailing list