Skip to content

Commit

Permalink
improve scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Mar 6, 2024
1 parent 76c0608 commit 1f4cc42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xmake/core/base/scheduler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1f4cc42

Please sign in to comment.