[Issue 4419] __gshared static in class has no effect
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Sep 13 06:44:43 PDT 2013
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=4419
--- Comment #9 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-13 06:44:41 PDT ---
(In reply to comment #8)
> class MyClass {
>     shared chan!bool ready = makeChan!bool(1);
> }
> 
> creates a static instance which is shared among all classes and sub classes.
I can't reproduce this, can you paste what 'chan' is, or just paste the full
example? E.g.:
-----
class C
{
    shared bool ready = false;
    static shared bool statReady = false;
}
void main()
{
    auto a = new C;
    auto b = new C;
    a.ready = true;
    assert(b.ready == false);
    assert(&a.ready !is &b.ready);
    a.statReady = true;
    assert(b.statReady == true);
    assert(&a.statReady is &b.statReady);
}
-----
-- 
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