[Issue 8295] Struct member destructor can not be called from shared struct instance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 17 11:38:39 UTC 2018


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

--- Comment #11 from Marco Leise <Marco.Leise at gmx.de> ---
Uh, I think I just contradicted my two years younger self from the linked bug
report. I guess whether or not `stdout` (or any reference counter) should use
atomic operations must not depend on whether the struct itself is `shared` for
the afore mentioned reasons. `stout` being a global variable should of course
be `shared`, but threads are free to create a local, unshared copy of that RC
pointer. These copies would still uses atomic operations internally. That way I
can reconcile the both of me.

TL;DR Let's not use shared to signify whether an RC pointer should use atomic
ops internally. Value types can always be copied stripping their top-level
qualifiers!

--


More information about the Digitalmars-d-bugs mailing list