October 19, 2012 [Issue 8853] New: Unable to use std.concurrency.receive with Tuple!(immutable(int[])) | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8853 Summary: Unable to use std.concurrency.receive with Tuple!(immutable(int[])) Product: D Version: D2 Platform: x86_64 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: lomereiter@gmail.com --- Comment #0 from Artem Tarasov <lomereiter@gmail.com> 2012-10-19 11:01:09 PDT --- The following code compiles, but the program hangs (because the message is not received by foo()). Without wrapping array into struct everything works. If immutable(int[]) is changed to immutable(int)[] -- also works. import std.concurrency; struct A { immutable(int[]) a; } void foo(Tid tid) { receive( (A a) { send(tid, true); }); } void main() { Tid tid = spawn(&foo, thisTid); immutable(int[]) a = [1]; send(tid, A(a)); receiveOnly!bool(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 21, 2013 [Issue 8853] Unable to use std.concurrency.receive with Tuple!(immutable(int[])) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Artem Tarasov | http://d.puremagic.com/issues/show_bug.cgi?id=8853 Stephan <stephan.schiffels@mac.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stephan.schiffels@mac.com --- Comment #1 from Stephan <stephan.schiffels@mac.com> 2013-01-21 10:01:24 PST --- I would like to add my own program to this issue, which also hangs, most likely due to the same reason. If you remove ANY of the three members of the struct (and edit the message accordingly), the program passes normally. Only with all three struct members, it hangs: import std.stdio; import std.concurrency; struct message_t { string str; int num; immutable(int)[] vec; } void func(Tid caller) { auto msg = message_t("foo", 42, [1, 2, 3]); caller.send(msg); } void main() { spawn(&func, thisTid); auto msg = receiveOnly!(message_t); writeln("received: ", msg); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation