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


David Simcha <dsim...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #1 from David Simcha <dsim...@yahoo.com> 2011-06-08 19:30:43 PDT ---
Exceptions thrown from within tasks are re-thrown when you call done(),
workForce(), yieldForce(), or spinForce() on the Task object.  You created an
anonymous task and never called any of these functions.  The following slightly
modified code does re-throw the exception.

import std.exception;
import std.parallelism;

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

void main()
{
    int[] tasks = [1, 2, 3];
    auto t = task!foo(4);
    taskPool.put(t);
    foreach (task; taskPool.parallel(tasks))
    {
        foo(task);
    }

    t.yieldForce();
}

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

Reply via email to