[Issue 5317] New: Assertion is not work in a function called by std.concurrency.spawn

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 4 11:31:43 PST 2010


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

           Summary: Assertion is not work in a function called by
                    std.concurrency.spawn
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: rayerd.wiz at gmail.com


--- Comment #0 from Haruki Shigemori <rayerd.wiz at gmail.com> 2010-12-04 11:30:04 PST ---
// a.d
import std.stdio, std.concurrency;
void f()
{
//    try
//    {
        writeln("1");
        assert(false);
//    }
//    catch(Throwable t)
//    {
//      writeln(t);
//      throw t;
//    }
}
void main()
{
    auto tid = spawn(&f);
    readln();
}

$ dmd a.d
1
<=== Needs assertion failure message here!

I found that assertion is not work in a function called by spawn.
You will get the following result if you remove comment keywords.

$ dmd a.d
1
core.exception.AssertError at a(7): Assertion failure

-- 
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