[Issue 4957] New: std.concurrency does not allow to pass Tid in struct fields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 29 12:14:38 PDT 2010


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

           Summary: std.concurrency does not allow to pass Tid in struct
                    fields
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: osa8aso at gmail.com


--- Comment #0 from osa8aso at gmail.com 2010-09-29 12:14:23 PDT ---
send() allows to Tid only as a top-level parameter. Using Tid in a struct does
not work. This compiles:
----
import std.concurrency;
void main() {
    send( thisTid, thisTid );
    receive( Tid );
}
----

This fails to compile:
----
import std.concurrency;
struct Message { Tid tid; }
void main() {
    send( thisTid, Message( thisTid ) );
    receive( ( Message ) {} );
}
---
std/concurrency.d(363): Error: static assert  "Aliases to mutable thread-local
data not allowed."
c.d(4):        instantiated from here: send!(Message)

So Tid is not mutable when passed to send() directly, but as a part of struct
Message, it suddenly becomes mutable?

-- 
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