diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua index 12808a1629f..6944afec09b 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)