From a89533ca36547bf3c3910720361635507fc18ad1 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Tue, 31 Jul 2018 15:36:20 +0200 Subject: [PATCH] correctly return finshed --- coroutine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coroutine.h b/coroutine.h index 000c9e1..ca2ff53 100644 --- a/coroutine.h +++ b/coroutine.h @@ -164,7 +164,7 @@ inline int resume(routine_t id) SwitchToFiber(routine->fiber); } - return 0; + return routine->finished ? -2 : 0; } inline void yield() @@ -346,7 +346,7 @@ inline int resume(routine_t id) swapcontext(&ordinator.ctx, &routine->ctx); } - return 0; + return routine->finished ? -2 : 0; } inline void yield()