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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 22 15:22:37 PST 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at 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: -------


More information about the Digitalmars-d-bugs mailing list