Thread overview
[Issue 24269] Members inside synchronized method should be only tail shared
Dec 03, 2023
Nick Treleaven
Dec 03, 2023
Nick Treleaven
Dec 28, 2023
anonymous4
December 03, 2023
https://issues.dlang.org/show_bug.cgi?id=24269

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |TDPL

--
December 03, 2023
https://issues.dlang.org/show_bug.cgi?id=24269

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
class C
{
    int i;
    synchronized void bar() {
        pragma(msg, typeof(i)); // shared(int)
    }
}

The pragma should print `int`.

--
December 28, 2023
https://issues.dlang.org/show_bug.cgi?id=24269

anonymous4 <dfj1esp02@sneakemail.com> changed:

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

--- Comment #2 from anonymous4 <dfj1esp02@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
    }
}
---

--