Synchronized classes have no public members
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Tue Oct 13 05:56:32 PDT 2015
On Tuesday, 13 October 2015 at 06:58:28 UTC, Andrei Alexandrescu
wrote:
> https://github.com/D-Programming-Language/dmd/pull/5188
> implements a rule defined in TDPL: synchronized classes shall
> have no public members.
>
> The motivation behind this limitation is that member accesses
> in synchronized objects should not occur without some handshake
> occurring. Public members would make that possible and easy.
>
> Walter and I are on board with this change. However, it is a
> breaking change so we want to gather a level of community
> support before we push the button.
>
>
> Thanks,
>
> Andrei
I still have no idea why I would ever use `synchronized` (any
automatic thread synchronization is harmful in my opinion) so
change itself is irrelevant. But it may break quite some old
Java-liked 3d party code for no benefit and that would be
annoying.
More information about the Digitalmars-d
mailing list