diff options
| author | ruki <[email protected]> | 2025-03-27 00:41:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-08 15:31:55 +0800 |
| commit | 4fee5fe56d3eedb3871ee237b083bb3bcbf6ec5c (patch) | |
| tree | c381d54e4344939c3e078dce5f175dcc34ae6553 /xmake/modules | |
| parent | 01733eaae58b4aec4374868bcab18ee8c95c56ae (diff) | |
fix jobgraph for isolated vertex
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/async/jobgraph.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/async/jobgraph.lua b/xmake/modules/async/jobgraph.lua index 3767cfe73..d737c7348 100644 --- a/xmake/modules/async/jobgraph.lua +++ b/xmake/modules/async/jobgraph.lua @@ -70,10 +70,12 @@ end -- function jobgraph:add(name, run, opt) opt = opt or {} + local dag = self._dag local jobs = self._jobs if not jobs[name] then local job = {name = name, run = run, opt = opt} jobs[name] = job + dag:add_vertex(job) self._size = self._size + 1 if opt.groups then @@ -91,9 +93,9 @@ end -- remove a given job function jobgraph:remove(name) + local dag = self._dag local jobs = self._jobs local job = jobs[name] - local dag = self._dag if job then assert(self._size > 0) jobs[name] = nil |
