[Issue 4419] New: __gshared static in class has no effect

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 3 04:11:05 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4419

           Summary: __gshared static in class has no effect
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: torhu at yahoo.com


--- Comment #0 from torhu at yahoo.com 2010-07-03 04:11:02 PDT ---
DMD 2.047.

Putting __gshared in front of static has no effect.  Putting it after works.

This example prints "0", instead of the expected "1":

---
import core.thread;
import std.stdio;

class A { __gshared static int x; }


void main()
{
    A.x = 1;
    Thread t = new Thread({ writeln(A.x); });
    t.start();
}
---

-- 
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