Weaken the task double-resumption assertion condition.

This assertion got triggered in a number of harmless situations and it's not always easy to avoid. Trying to avoid it, it has already caused a rather bad task starvation bug (#1441), so at this point it seems to be better to get rid of it.

See also #1407

(cherry picked from commit 621e34b388848c762a7525149ea449ad082996a1)
This commit is contained in:
Sönke Ludwig 2016-04-10 14:20:05 +02:00
parent 27e0019e44
commit 8f4222916f

View file

@ -1274,13 +1274,16 @@ package(vibe) void resumeCoreTask(CoreTask ctask, Exception event_exception = nu
nothrow @safe { nothrow @safe {
assert(ctask.thread is () @trusted { return Thread.getThis(); } (), "Resuming task in foreign thread."); assert(ctask.thread is () @trusted { return Thread.getThis(); } (), "Resuming task in foreign thread.");
assert(() @trusted nothrow { return ctask.state; } () == Fiber.State.HOLD, "Resuming fiber that is not on HOLD"); assert(() @trusted nothrow { return ctask.state; } () == Fiber.State.HOLD, "Resuming fiber that is not on HOLD");
assert(ctask.m_queue is null, "Manually resuming task that is already scheduled to be resumed.");
if (event_exception) { if (event_exception) {
extrap(); extrap();
assert(!ctask.m_exception, "Resuming task with exception that is already scheduled to be resumed with exception.");
ctask.m_exception = event_exception; ctask.m_exception = event_exception;
} }
// do nothing if the task is aready scheduled to be resumed
if (ctask.m_queue) return;
auto uncaught_exception = () @trusted nothrow { return ctask.call!(Fiber.Rethrow.no)(); } (); auto uncaught_exception = () @trusted nothrow { return ctask.call!(Fiber.Rethrow.no)(); } ();
if (uncaught_exception) { if (uncaught_exception) {