From: Andre Noll Date: Mon, 31 Mar 2008 20:35:06 +0000 (+0200) Subject: sched: Only call pre/post select hooks if tasks are not in error state. X-Git-Tag: v0.3.2~41 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6f0e4a5138f17d0a150f648fd09fe867c080660a sched: Only call pre/post select hooks if tasks are not in error state. --- diff --git a/sched.c b/sched.c index 5d4901df..5f7babe7 100644 --- a/sched.c +++ b/sched.c @@ -50,7 +50,8 @@ static void sched_preselect(struct sched *s) { struct task *t, *tmp; list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) { - t->pre_select(s, t); + if (t->error >= 0) + t->pre_select(s, t); // PARA_INFO_LOG("%s \n", t->status); if (t->error >= 0) continue; @@ -71,7 +72,8 @@ static void sched_post_select(struct sched *s) struct task *t, *tmp; list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) { - t->post_select(s, t); + if (t->error >= 0) + t->post_select(s, t); // PARA_INFO_LOG("%s: %d\n", t->status, t->ret); if (t->error >= 0) continue; @@ -172,7 +174,6 @@ void sched_shutdown(void) return; list_for_each_entry_safe(t, tmp, &pre_select_list, pre_select_node) unregister_task(t); - /* remove tasks which do not have a pre_select hook */ list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) unregister_task(t); initialized = 0;