You are right:
import std.stdio, std.concurrency;
import std.concurrency : MessageBox;

struct MyTid
{
    MessageBox mbox;
}

static void f1() {
    auto tT = cast(MyTid)thisTid;
    auto oT = cast(MyTid)ownerTid;
    writeln("F1:worker: ", cast(void*)tT.mbox);
    writeln("F1:owner: ", cast(void*)oT.mbox);
}

void main() {
    auto tT = cast(MyTid)thisTid();
    auto sT = cast(MyTid)spawn(&f1);
    writeln("Main:worker: ", cast(void *)sT.mbox);
    writeln("Main:owner: ", cast(void *)tT.mbox);
}


On Tue, Feb 9, 2016 at 4:55 PM, Ali Çehreli <
[email protected]> wrote:

> On 02/09/2016 07:52 AM, Daniel Kozak via Digitalmars-d-learn wrote:
>
>> It is OK, I guess the output is just mixed
>>
>
> Yes, that's an important point but it is not the reason. (Just tested.)
>
> I think this is just an issue with how Tid objects are printed. Otherwise,
> everything works as expected and although they print the same value,
> "worker1 != worker2" is true as well.
>
> Ali
>
>

Reply via email to