From 6f0e4a5138f17d0a150f648fd09fe867c080660a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 31 Mar 2008 22:35:06 +0200 Subject: [PATCH] sched: Only call pre/post select hooks if tasks are not in error state. --- sched.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 2.30.2