--- libaitsched/src/hooks.c 2014/05/21 20:48:34 1.27.2.1 +++ libaitsched/src/hooks.c 2014/05/21 21:55:10 1.27.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.27.2.1 2014/05/21 20:48:34 misho Exp $ +* $Id: hooks.c,v 1.27.2.2 2014/05/21 21:55:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -267,7 +267,8 @@ sched_hook_cancel(void *task, void *arg __unused) #endif /* EVFILT_USER */ case taskTHREAD: #ifdef HAVE_LIBPTHREAD - pthread_cancel((pthread_t) TASK_VAL(t)); + if (TASK_VAL(t)) + pthread_cancel((pthread_t) TASK_VAL(t)); #endif return NULL; #if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE)