diff options
| -rw-r--r-- | xmake/core/base/scheduler.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua index 760c24aee..ac7aed9cc 100644 --- a/xmake/core/base/scheduler.lua +++ b/xmake/core/base/scheduler.lua @@ -593,9 +593,8 @@ function scheduler:co_unlock(lockname) if co_waiting_tasks then local waiting_tasks = co_waiting_tasks[lockname] if waiting_tasks and #waiting_tasks > 0 then - local co_task = waiting_tasks[#waiting_tasks] - if co_task then - table.remove(waiting_tasks) + co_waiting_tasks[lockname] = nil + for _, co_task in ipairs(waiting_tasks) do if co_task:is_suspended() then local ok, errors = self:co_resume(co_task) if not ok then |
