Skip to content

Commit 1f4cc42

Browse files
committed
improve scheduler
1 parent 76c0608 commit 1f4cc42

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xmake/core/base/scheduler.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ function scheduler:_poller_resume_co(co, events)
179179
events = poller.EV_POLLER_ERROR
180180
end
181181

182-
-- this coroutine must be suspended
183-
assert(co:is_suspended())
182+
-- this coroutine must be suspended, (maybe also dead)
183+
if not co:is_suspended() then
184+
return false, string.format("%s cannot be resumed, status: %s", co, co:status())
185+
end
184186

185187
-- resume this coroutine task
186188
co:waitobj_set(nil)

0 commit comments

Comments
 (0)