From 1f4cc42199c464ba06fa91b5beac0be14d72312f Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 7 Mar 2024 00:03:06 +0800 Subject: improve scheduler --- xmake/core/base/scheduler.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua index 12808a162..6944afec0 100644 --- a/xmake/core/base/scheduler.lua +++ b/xmake/core/base/scheduler.lua @@ -179,8 +179,10 @@ function scheduler:_poller_resume_co(co, events) events = poller.EV_POLLER_ERROR end - -- this coroutine must be suspended - assert(co:is_suspended()) + -- this coroutine must be suspended, (maybe also dead) + if not co:is_suspended() then + return false, string.format("%s cannot be resumed, status: %s", co, co:status()) + end -- resume this coroutine task co:waitobj_set(nil) -- cgit v1.3.1