From e6940831fbcf21dd0e6243ca89ea0c7f8b195d9e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 1 Apr 2008 21:57:33 +0200 Subject: [PATCH] unregister_task(): Set error status to E_TASK_UNREGISTERED This way the users know when it's safe to free the memory containing the task struct. --- error.h | 1 + sched.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/error.h b/error.h index 6b8403d1..c2f993d0 100644 --- a/error.h +++ b/error.h @@ -166,6 +166,7 @@ extern const char **para_errlist[]; #define SCHED_ERRORS \ PARA_ERROR(TASK_KILLED, "task killed"), \ + PARA_ERROR(TASK_UNREGISTERED, "task has been unscheduled"), \ PARA_ERROR(NO_SUCH_TASK, "task not found"), \ PARA_ERROR(NOT_INITIALIZED, "scheduler not yet initialized"), \ diff --git a/sched.c b/sched.c index 25004060..b9d64286 100644 --- a/sched.c +++ b/sched.c @@ -41,8 +41,7 @@ void unregister_task(struct task *t) list_del(&t->pre_select_node); if (t->post_select) list_del(&t->post_select_node); - if (t->error >= 0) - t->error = -E_TASK_KILLED; + t->error = -E_TASK_UNREGISTERED; }; -- 2.39.5