From 3a6583b375a0712fbf6f1dfec45b13c489e3d385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 10 Apr 2016 14:18:14 +0200 Subject: [PATCH] Explictly avoid double-resumption of tasks during Libevent2TCPConnection.close(). The previous fix for #1376 resulted in a possible task starvation when the peer reset the connection before the outbound buffer was drained. The new approach now always resumes the waiting task exactly once, no matter how many events happen and no matter in which order. (cherry picked from commit 350130a2b05cfbf12764ffaa6a86403eacf172d9) --- source/vibe/core/core.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index d904849..1d66cca 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -1274,7 +1274,7 @@ package(vibe) void resumeCoreTask(CoreTask ctask, Exception event_exception = nu nothrow @safe { 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(ctask.m_queue is null, "Manually resuming task that is already scheduled to resumed."); + assert(ctask.m_queue is null, "Manually resuming task that is already scheduled to be resumed."); if( event_exception ){ extrap();