www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7074] New: std.concurrency.receive segfaults when called from new thread

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7074

           Summary: std.concurrency.receive segfaults when called from new
                    thread
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: code klickverbot.at



---
Not sure if this is expected:
---
import core.thread;
import std.concurrency;
void main() {
  (new Thread({receive((bool b){});})).start();
}
---

crashes using Phobos c83edad (2.057 beta), because the mbox of the newly
created thread has not been initialized yet (it is for the main thread in a
shared static constructor, and by spawn() for threads created by it).

Workaround: Force initialization of mbox by calling std.concurrency.thisTid on
the new thread first.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 06 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7074


ratchet freak <ratchet.freak gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ratchet.freak gmail.com



PDT ---
fix: use thisTid in recieve instead of accessing mbox directly

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