[Issue 11309] New: std.concurrency: OwnerTerminated message doesn't work
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 20 18:44:11 PDT 2013
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: nobody at puremagic.com
ReportedBy: mk at krej.cz
--- Comment #0 from Martin Krejcirik <mk at 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: -------
More information about the Digitalmars-d-bugs
mailing list