Bug 14932 – The language specification does not define what the shared attribute does

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-18T20:51:45Z
Last change time
2023-03-17T21:44:19Z
Keywords
pull, spec
Assigned to
No Owner
Creator
Jack Stouffer
See also
https://issues.dlang.org/show_bug.cgi?id=16198

Comments

Comment #0 by jack — 2015-08-18T20:51:45Z
Comment #1 by dfj1esp02 — 2017-01-20T13:27:07Z
Well, ok, not quite in spec: https://dlang.org/migrate-to-shared.html#shared It marks data shared across threads - that's what it does. > This enables static checking and sharing correctness Maybe this sentence is broadly interpreted. I think sharing correctness is provided by ruling out possibility to confuse shared data with unshared data, which is implemented by disallowing implicit conversion between shared and unshared data, see https://dlang.org/spec/const3.html#implicit_conversions
Comment #2 by dlang-bot — 2023-03-16T13:10:41Z
@ntrel created dlang/dlang.org pull request #3556 "Fix Issue 14932 - spec does not define what shared attribute does" fixing this issue: - Fix Issue 14932 - language spec does not define what shared does Normal initialization of shared vars is OK. Add atomicStore, atomicLoad example. Add example showing casting to shared. Mention shared globals use common storage not TLS. https://github.com/dlang/dlang.org/pull/3556
Comment #3 by dlang-bot — 2023-03-17T21:44:19Z
dlang/dlang.org pull request #3556 "Fix Issue 14932 - spec does not define what shared attribute does" was merged into master: - 391a00ed0f6e0795153534269dc6218c0a6179e7 by Nick Treleaven: Fix Issue 14932 - language spec does not define what shared does Normal initialization of shared vars is OK. Add atomicStore, atomicLoad example. Add example showing casting to shared. Mention shared globals use common storage not TLS. https://github.com/dlang/dlang.org/pull/3556