[Issue 4419] __gshared static in class has no effect

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 13 13:58:40 PDT 2013


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



--- Comment #10 from Rory <rjmcguire at gmail.com> 2013-09-13 13:58:37 PDT ---
(In reply to comment #9)

> I can't reproduce this, can you paste what 'chan' is, or just paste the full
> example? E.g.:
> 

Could you try this?
class B { bool v;}

class C
{
    shared B ready = new shared B;
    static shared B statReady = new shared B;

}

void main()
{
    auto a = new C;
    auto b = new C;
    a.ready.v = true;
    assert(b.ready.v == false);
    assert(&a.ready.v !is &b.ready.v);

    a.statReady.v = true;
    assert(b.statReady.v == true);
    assert(&a.statReady.v is &b.statReady.v);
}

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