Skip to content

Commit af9a418

Browse files
committed
fix itable iteration bug in vine_worker
1 parent abbff8d commit af9a418

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

taskvine/src/worker/vine_worker.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,14 +1103,15 @@ then we need to abort to clean things up.
11031103

11041104
static void kill_all_tasks()
11051105
{
1106-
struct vine_process *p;
1107-
uint64_t task_id;
1106+
uint64_t *task_ids = itable_keys_array(procs_table);
1107+
int total_tasks = itable_size(procs_table);
11081108

1109-
ITABLE_ITERATE(procs_table, task_id, p)
1110-
{
1111-
do_kill(task_id);
1109+
for (int i = 0; i < total_tasks; i++) {
1110+
do_kill(task_ids[i]);
11121111
}
11131112

1113+
itable_free_keys_array(task_ids);
1114+
11141115
assert(itable_size(procs_table) == 0);
11151116
assert(itable_size(procs_running) == 0);
11161117
assert(itable_size(procs_complete) == 0);

0 commit comments

Comments
 (0)