[Issue 10108] Thread local slice to array literal references the same data

Sean Kelly sean at invisibleduck.org
Sat May 18 07:59:53 PDT 2013


This is expected because the global is __gshared and there's therefore no type protection from doing this. If you want safe sharing, make the global shared. 

On May 17, 2013, at 9:38 AM, d-bugmail at puremagic.com wrote:

> http://d.puremagic.com/issues/show_bug.cgi?id=10108
> 
> 
> 
> --- Comment #2 from Martin Nowak <code at dawg.eu> 2013-05-17 09:38:22 PDT ---
> When a thread local variable is a reference type to modifiable data, we must
> make sure that it is initialized uniquely.
> 
> This is what the current implementation does which results in hidden sharing.
> 
> __gshared int[] gArr = [1,2,3];
> int[] arr = gArr;
> 
> -- 
> Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list