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

           Summary: std.concurrency: OwnerTerminated message doesn't work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: m...@krej.cz


--- Comment #0 from Martin Krejcirik <m...@krej.cz> 2013-10-21 03:44:09 CEST ---
Not sure where is the problem, but the thread doesn't end as expected.

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

void main()
{
    writeln("starting");
    auto tid = spawn(&worker);
    Thread.sleep(dur!"msecs"(100));
    tid.send(10);
    Thread.sleep(dur!"msecs"(100));
    writeln("finishing");
}

void worker()
{
    for (bool running = true; running; )
    {
        receive(
            (int m) { writeln("Got ", m); },
            (OwnerTerminated unused) { writeln("main ended"); running = false;
}
        );
    }
}
-----

DMD32 D Compiler v2.064-devel-9e9a329
Linux 32.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to