[Issue 24269] Members inside synchronized method should be only tail shared

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 28 10:13:11 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24269

anonymous4 <dfj1esp02 at sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from anonymous4 <dfj1esp02 at sneakemail.com> ---
It can't, because you can have unlocked methods:
---
class C
{
    int i;
    synchronized void bar() {
        pragma(msg, typeof(i)); // shared(int)
    }
    void inc() shared {
        atomicOp!"+="(i, 1); //expects cooperation
    }
}
---

--


More information about the Digitalmars-d-bugs mailing list