]> git.tue.mpg.de Git - paraslash.git/commitdiff
unregister_task(): Set error status to E_TASK_UNREGISTERED
authorAndre Noll <maan@systemlinux.org>
Tue, 1 Apr 2008 19:57:33 +0000 (21:57 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 1 Apr 2008 19:57:33 +0000 (21:57 +0200)
This way the users know when it's safe to free the memory
containing the task struct.

error.h
sched.c

diff --git a/error.h b/error.h
index 6b8403d1a91c3fd67e2a73f5e971f07896970e43..c2f993d0bd8707f8c4efe2a4d7d48147ed9df438 100644 (file)
--- 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 2500406005614dc3850a283e37057cc844608ac3..b9d642864624cd796e3853331cc9a652378c41c5 100644 (file)
--- 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;
 };