std.concurrency bug?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 21 13:19:32 PDT 2014


On 05/20/2014 05:24 PM, Charles Hixson via Digitalmars-d-learn wrote:

 > On Tuesday, May 20, 2014 11:42:48 AM Ali Çehreli via Digitalmars-d-learn
 > wrote:
 >> On 05/20/2014 11:38 AM, Charles Hixson via Digitalmars-d-learn wrote:
 >>> Is it a bug that an immutable struct cannot be sent to a thread?  (It
 >>> compiles without problem if I make all elements mutable.)

Further reduced:

import std.concurrency;

struct S
{
     immutable int i;
}

void foo()
{}

void main()
{
     auto f = spawn(&foo);

     auto s = S();
     f.send(s);
}

I think this is a known issue with immutable and Variant, which 
std.concurrency uses for unknown messages. This looks related:

   https://issues.dlang.org/show_bug.cgi?id=5538

Ali



More information about the Digitalmars-d-learn mailing list