--- libaitsched/src/tasks.c 2012/08/22 10:38:21 1.13.2.2 +++ libaitsched/src/tasks.c 2012/08/22 23:43:36 1.13.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: tasks.c,v 1.13.2.2 2012/08/22 10:38:21 misho Exp $ +* $Id: tasks.c,v 1.13.2.3 2012/08/22 23:43:36 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -117,8 +117,13 @@ _sched_threadJoin(sched_task_t *task) return NULL; #ifdef HAVE_LIBPTHREAD - pthread_join((pthread_t) TASK_VAL(task), &ret); - TASK_ROOT(task)->root_ret = ret; + if (pthread_kill((pthread_t) TASK_VAL(task), 0)) { + pthread_join((pthread_t) TASK_VAL(task), &ret); + TASK_ROOT(task)->root_ret = ret; + } else { + usleep(10000); + schedTaskSelf(task); + } #endif return NULL;