[Issue 6224] Make a read-only public ownerTid property for std.concurrency

2013-01-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6224


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 OS/Version|Windows |All


--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-22 
15:22:35 PST ---
Ok apparently there's a global but private 'owner' Tid. The problem is this is
equal to Tid.init for the main thread since Tid is a struct. I don't think it's
wise to simply return:

/**
 * Return the Tid of the thread which
 * spawned the caller's thread.
 */
@property Tid ownerTid()
{
return owner;
}

As calling ownerTid.send() will segfault due to mbox being null. So what should
be done instead, maybe throw an exception in ownerTid() if mbox is null?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6224] Make a read-only public ownerTid property for std.concurrency

2013-01-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6224



--- Comment #3 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-22 
15:24:33 PST ---
(In reply to comment #2)
 The problem is this is
 equal to Tid.init for the main thread since Tid is a struct.

That wasn't worded properly. It's .init because it doesn't have a parent,
regardless of whether it's a struct or class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 6224] Make a read-only public ownerTid property for std.concurrency

2011-06-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6224



--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2011-06-29 
16:11:36 PDT ---
I forgot I can also use spawn to send the Tid, e.g.:

void workThreadFoo(Tid mainThread)
{
}

spawn(workThreadFoo, thisTid);

It would still be nice to have a ownerTid property though, this is a feature
request. :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---