--- libaitsched/inc/aitsched.h 2012/08/21 12:54:39 1.15 +++ libaitsched/inc/aitsched.h 2012/08/21 13:15:49 1.15.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsched.h,v 1.15 2012/08/21 12:54:39 misho Exp $ +* $Id: aitsched.h,v 1.15.2.1 2012/08/21 13:15:49 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -663,6 +663,14 @@ sched_task_t *schedThread(sched_root_task_t * __restri pthread_exit((void*) (x)); \ } else \ return ((void*) (x)); \ +} while (0) +#define taskKill(t, s) do { assert((t) && TASK_ROOT(t)); \ + if (TASK_TYPE(t) == taskTHREAD) { \ + pthread_t _tid = (pthread_t) TASK_VAL((t)); \ + sched_unuseTask(t); \ + pthread_kill(_tid, (s)); \ + } else \ + schedCancel((t)); \ } while (0)