Bug 23790 – Cannot use cas on member variable with -preview=nosharedaccess
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-03-17T13:53:10Z
Last change time
2023-04-01T22:15:14Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Atila Neves
Comments
Comment #0 by atila.neves — 2023-03-17T13:53:10Z
---------------------
import core.atomic;
struct Argh {
bool locked;
void lock() shared {
while(!cas(&locked, false, true)) { }
}
}
---------------------
Yields:
d.d(5): Error: direct access to shared `this` is not allowed, see `core.atomic`
Comment #1 by dlang-bot — 2023-03-21T12:50:24Z
@RazvanN7 created dlang/dmd pull request #15016 "Fix Issue 23790 - Cannot use cas on member variable with -preview=nosharedaccess" fixing this issue:
- Fix Issue 23790 - Cannot use cas on member variable with -preview=nosharedaccess
https://github.com/dlang/dmd/pull/15016
Comment #2 by dlang-bot — 2023-03-22T08:47:39Z
dlang/dmd pull request #15016 "Fix Issue 23790 - Cannot use cas on member variable with -preview=nosharedaccess" was merged into stable:
- c9a887f51541d829469636b4eb13dd61cc807924 by RazvanN7:
Fix Issue 23790 - Cannot use cas on member variable with -preview=nosharedaccess
https://github.com/dlang/dmd/pull/15016
Comment #3 by dlang-bot — 2023-04-01T22:15:14Z
dlang/dmd pull request #15066 "merge stable" was merged into master:
- 270845e4263b3043c444bbb3ba22d375493bf88e by Razvan Nitu:
Fix Issue 23790 - Cannot use cas on member variable with -preview=nosharedaccess (#15016)
https://github.com/dlang/dmd/pull/15066