From: Andre Noll Date: Tue, 1 Apr 2008 19:57:33 +0000 (+0200) Subject: unregister_task(): Set error status to E_TASK_UNREGISTERED X-Git-Tag: v0.3.2~36 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=e6940831fbcf21dd0e6243ca89ea0c7f8b195d9e;hp=5132ecf659d4b578dd14181c8a7de043dbc6807a 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. --- 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; };