Is comparison of shared data thread-safe?

Nick Treleaven nick at geany.org
Thu Mar 16 17:15:09 UTC 2023


On Thursday, 16 March 2023 at 12:32:34 UTC, Nick Treleaven wrote:
> With -preview=nosharedaccess, I get:
>
>     int y = 2;
>     shared int x = y; // OK
>
>     assert(x == 2); // no error
>     y = x; // error

This also does not error:
```d
bool b = x == 3;
```
Filed:
https://issues.dlang.org/show_bug.cgi?id=23783


More information about the Digitalmars-d-learn mailing list