Bug 4643 – Shared values are unwritable

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-14T03:09:00Z
Last change time
2010-12-13T02:44:13Z
Assigned to
nobody
Creator
simen.kjaras

Comments

Comment #0 by simen.kjaras — 2010-08-14T03:09:59Z
shared int n; void main( ) { writeln( n ); } This program fails with: E:\DMD\DMD2\windows\bin\..\..\src\phobos\std\format.d(306): Error: cannot implic itly convert expression (& arg) of type shared(int)* to const(void)*
Comment #1 by dsimcha — 2010-09-04T09:02:33Z
http://dsource.org/projects/phobos/changeset/1957 Fixed for shared values w/o aliasing. For shared values w/ aliasing, it shouldn't work because if one thread tries to write the value while another thread modifies it, Bad Things Will Happen (TM).