--- libaitsched/src/hooks.c 2012/08/21 12:50:08 1.13.2.3 +++ libaitsched/src/hooks.c 2012/08/22 10:33:45 1.14.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.13.2.3 2012/08/21 12:50:08 misho Exp $ +* $Id: hooks.c,v 1.14.2.1 2012/08/22 10:33:45 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -210,6 +210,10 @@ sched_hook_cancel(void *task, void *arg __unused) case taskTHREAD: #ifdef HAVE_LIBPTHREAD pthread_cancel((pthread_t) TASK_VAL(t)); + while (!pthread_kill((pthread_t) TASK_VAL(t), 0)); + if (TASK_FLAG(t) == PTHREAD_CREATE_JOINABLE) /* joinable thread */ + schedTask(TASK_ROOT(t), _sched_threadJoin, TASK_ARG(t), + TASK_VAL(t), TASK_DATA(t), TASK_DATLEN(t)); #endif TASK_UNLOCK(t); default: