digitalmars.D - structs, tids, and concurrency.
- Nathan M. Swan (25/25) Mar 30 2012 Nesting a Tid in a struct is interpreted as having local
- Timon Gehr (2/4) Mar 30 2012 http://d.puremagic.com/issues/show_bug.cgi?id=4957
Nesting a Tid in a struct is interpreted as having local
aliasing, though a bare Tid is not.
This doesn't work, though commenting out "receiveOnly!S()" and
"tid.send(S(thisTid))" works:
-----
import std.stdio;
import std.concurrency;
void main() {
auto thread = spawn(function void(Tid tid)
{
tid.send(thisTid);
tid.send(S(thisTid));
}, thisTid);
receiveOnly!Tid();
receiveOnly!S();
}
struct S {
Tid tid;
}
-----
$ rdmd test.d
/usr/share/dmd/src/phobos/std/concurrency.d(319): Error: static
assert "Aliases to mutable thread-local data not allowed."
../test.d(9): instantiated from here: send!(S)
Failed: dmd -v -o- '../test.d' -I'..' >../test.d.deps
Mar 30 2012
On 03/30/2012 10:18 AM, Nathan M. Swan wrote:Nesting a Tid in a struct is interpreted as having local aliasing, though a bare Tid is not.http://d.puremagic.com/issues/show_bug.cgi?id=4957
Mar 30 2012








Timon Gehr <timon.gehr gmx.ch>