[Issue 6126] New: std.parallelism does not re-throw exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 8 13:22:24 PDT 2011


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

           Summary: std.parallelism does not re-throw exception
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: robert at octarineparrot.com


--- Comment #0 from Robert Clipsham <robert at octarineparrot.com> 2011-06-08 21:17:51 BST ---
The following code:
----
import std.exception;
import std.parallelism;

void foo(int task)
{
    enforce(task != 4);
}

void main()
{
    int[] tasks = [1, 2, 3];
    taskPool.put(task!foo(4));
    foreach (task; taskPool.parallel(tasks))
    {
        foo(task);
    }
}
----
Does not re-throw the exception when the task uses .put() then .parallel() is
used to run the tasks. Changing the enforcement to == causes three exceptions
to be thrown as expected.

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