http://d.puremagic.com/issues/show_bug.cgi?id=10108
Sean Kelly <s...@invisibleduck.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |s...@invisibleduck.org --- Comment #14 from Sean Kelly <s...@invisibleduck.org> 2013-05-21 11:47:20 PDT --- So I thought I understood this: import core.thread; int[] arr = [1,2,3].dup; void main() { auto t = new Thread({arr[0] = 3;}); t.start(); t.join(); assert(arr[0] == 1); } It looks like we have a thread-local reference "arr" to a __gshared array of int, so I would expect the assert to fail. Except: import core.thread; int[] arr = [1,2,3].dup; void main() { auto t = new Thread({arr[0] = 3;}); t.start(); t.join(); assert(arr[0] == 1); } The .dup should fix the problem, as now each thread gets its own copy of the array, right? But the assert still fails. I suppose I should check the ASM, but the codegen seems kind of broken here. Is a __gshared label being inferred for arr because it's statically slicing __gshared data? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------