--- libaitsched/src/aitsched.c 2012/04/24 13:29:28 1.6.2.1 +++ libaitsched/src/aitsched.c 2012/04/26 08:03:27 1.6.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsched.c,v 1.6.2.1 2012/04/24 13:29:28 misho Exp $ +* $Id: aitsched.c,v 1.6.2.2 2012/04/26 08:03:27 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -484,17 +484,17 @@ schedRun(sched_root_task_t * __restrict root, volatile if (root->root_hooks.hook_exec.fetch) { if (killState) { if (root->root_hooks.hook_exec.condition) - while (root->root_hooks.hook_exec.condition(root, (void*) killState)) { + while (root && root->root_hooks.hook_exec.condition(root, (void*) killState)) { if ((task = root->root_hooks.hook_exec.fetch(root, NULL))) schedCall(task); } else - while (!*killState) { + while (!*killState && root) { if ((task = root->root_hooks.hook_exec.fetch(root, NULL))) schedCall(task); } } else - while (42) + while (root) if ((task = root->root_hooks.hook_exec.fetch(root, NULL))) schedCall(task); }