diff options
| author | ruki <[email protected]> | 2022-08-30 22:53:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-30 22:53:32 +0800 |
| commit | 8aa538adbd840ae27a5f693c5117f17153dd49de (patch) | |
| tree | eee695e4931850b9daee058b2cf95a0d6e46318a | |
| parent | 609805ce753cbfffc053cbcc9e40f596405694f7 (diff) | |
fix jobpool
| -rw-r--r-- | xmake/modules/private/async/jobpool.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xmake/modules/private/async/jobpool.lua b/xmake/modules/private/async/jobpool.lua index 696515f08..84e85deaf 100644 --- a/xmake/modules/private/async/jobpool.lua +++ b/xmake/modules/private/async/jobpool.lua @@ -123,10 +123,14 @@ function jobpool:pop() -- update all parents nodes for _, p in ipairs(parents) do - p._priority = math.max(p._priority or 0, priority + 1) - p._deps:remove(job) - if p._deps:empty() and self._size > 0 then - table.insert(leafjobs, 1, p) + -- we need avoid add it the leafjobs repeatly, it will cause dead-loop when poping group job + if not p._leaf then + p._priority = math.max(p._priority or 0, priority + 1) + p._deps:remove(job) + if p._deps:empty() and self._size > 0 then + p._leaf = true + table.insert(leafjobs, 1, p) + end end end @@ -185,6 +189,7 @@ function jobpool:_genleafjobs(job, leafjobs, refs) end end else + job._leaf = true table.insert(leafjobs, job) end end |
