From 26d01d18ebec447c55e66362fb7388226442e823 Mon Sep 17 00:00:00 2001 From: David Alvarez Date: Fri, 14 Apr 2023 09:46:36 +0200 Subject: [PATCH] Support taskiter by allowing tasks to re-launch --- src/emu/task.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emu/task.c b/src/emu/task.c index 197307d..f182dfe 100644 --- a/src/emu/task.c +++ b/src/emu/task.c @@ -70,12 +70,12 @@ task_execute(struct task_stack *stack, struct task *task) return -1; } - if (task->state != TASK_ST_CREATED) { - err("cannot execute task %u: state is not created", task->id); + if (task->state != TASK_ST_CREATED && task->state != TASK_ST_DEAD) { + err("cannot execute task %u: state is not created or dead", task->id); return -1; } - if (task->thread != NULL) { + if (task->thread != NULL && task->state != TASK_ST_DEAD) { err("task already has a thread assigned"); return -1; }