From: Andre Noll Date: Tue, 1 Apr 2008 19:55:26 +0000 (+0200) Subject: kill_task(): Only set task error status. X-Git-Tag: v0.3.2~37 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=5132ecf659d4b578dd14181c8a7de043dbc6807a kill_task(): Only set task error status. It's not safe to call unregister_task() at this point as this function might be called from pre_select() or post_select(). Just set the task's error value to -E_TASK_KILLED. The task will then be unregistered on the next iteration of the scheduler loop. --- diff --git a/sched.c b/sched.c index 5f7babe7..25004060 100644 --- a/sched.c +++ b/sched.c @@ -236,7 +236,6 @@ int kill_task(char *id) if (strcmp(id, buf)) continue; t->error = -E_TASK_KILLED; - unregister_task(t); return 1; } list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) { @@ -244,7 +243,6 @@ int kill_task(char *id) if (strcmp(id, buf)) continue; t->error = -E_TASK_KILLED; - unregister_task(t); return 1; } return -E_NO_SUCH_TASK;