Sending Tid in a struct

Chris Katko ckatko at gmail.com
Sat Sep 29 04:46:49 UTC 2018


On Wednesday, 23 November 2016 at 08:47:56 UTC, Christian Köstlin 
wrote:
> On 03/03/2012 18:35, Timon Gehr wrote:
>> On 03/03/2012 12:09 PM, Nicolas Silva wrote:
>>> [...]
>> 
>> Yes, this seems to be a bug.
>> 
>> Workaround:
>> 
>> struct Foo{
>>     string s;
>>     Tid id;
>> }
>> 
>> void foo(){
>>     Foo foo;
>>     receive((Tuple!(string,"s",Tid,"id") 
>> bar){foo=Foo(bar.s,bar.id);});
>> }
>> 
>> void main(){
>>     auto id = spawn(&foo);
>>     id.send("string",id);
>>     ...
>> }
> I had a similar problem with this an it seems this is still a 
> bug with dmd 2.072.
>
> best regards,
> christian

So this appears to still be a bug in 2.078.0-beta.1. Sigh...

So the only way to actually use concurrency in D... is to use 
this hack? Or has it been fixed since January? Is there an 
official bug report?


More information about the Digitalmars-d-learn mailing list