--- libaitsched/src/hooks.c 2011/08/12 11:49:50 1.1.1.1.2.5 +++ libaitsched/src/hooks.c 2011/09/28 14:14:10 1.1.1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.1.1.1.2.5 2011/08/12 11:49:50 misho Exp $ +* $Id: hooks.c,v 1.1.1.1.2.7 2011/09/28 14:14:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -309,7 +309,13 @@ retry: timeout = NULL; if ((en = kevent(r->root_kq, NULL, 0, res, KQ_EVENTS, timeout)) == -1) { LOGERR; +#ifdef NDEBUG + /* kevent no exit by error, if non-debug version */ goto retry; +#else + /* diagnostic exit from scheduler if kevent error occur */ + return NULL; +#endif } nw.tv_sec = nw.tv_nsec = 0; @@ -348,12 +354,11 @@ retry: } break; } - if (kevent(r->root_kq, evt, 1, NULL, 0, &nw) == -1) LOGERR; } - /* timer update */ + /* timer update & put in ready queue */ clock_gettime(CLOCK_MONOTONIC, &nw); now.tv_sec = nw.tv_sec; now.tv_usec = nw.tv_nsec / 1000; @@ -387,4 +392,3 @@ retry: TAILQ_INSERT_TAIL(&r->root_unuse, task, task_node); return task; } -