[Issue 14251] synchronized (mtx) doesn't check attributes (pure, const)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 12 05:21:05 PDT 2016


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

Lodovico Giaretta <lodovico at giaretart.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lodovico at giaretart.net

--- Comment #6 from Lodovico Giaretta <lodovico at giaretart.net> ---
(In reply to Walter Bright from comment #5)
> I'm not convinced this is a bug. The _monitor field is one that is totally
> managed by the language, and it outside of its rules.

That is true. But having "logically inexistent" fields with different
attributes from "normal" fields means that these attributes can not be
"physically" exploited, but only "logically" enforced.

E.g.: if an immutable object has a mutable mutex, than an immutable object
cannot reside in read-only memory.

So it's a tradeoff, and it must be clearly defined what is D's way here.

--


More information about the Digitalmars-d-bugs mailing list