import core.thread;
import std.concurrency;
import std.stdio : w = writeln;

    void w2(shared(bool) *done)
    {
        while (*done == false)
        {
                Thread.sleep(100.msecs);
                w("print done? ", *done);
        }
    }

    void s2()
    {
        shared(bool) isDone = false;
        spawn(&w2, &isDone);
        Thread.sleep(400.msecs);
        isDone = true;

}

    void main()
    {
        s2();
    }

=========

a bug ?
thanks anyway
  • question fred via Digitalmars-d-learn

Reply via email to