--- libaitsched/inc/aitsched.h 2014/01/27 16:52:56 1.24.2.2 +++ libaitsched/inc/aitsched.h 2014/06/05 22:37:29 1.27 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsched.h,v 1.24.2.2 2014/01/27 16:52:56 misho Exp $ +* $Id: aitsched.h,v 1.27 2014/06/05 22:37:29 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 +Copyright 2004 - 2014 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -160,6 +160,7 @@ typedef struct sched_HooksTask hooks_task_t; /* task callback, like pthread callback! */ typedef void *(*sched_task_func_t)(sched_task_t * /* current task data*/); +#define SCHED_TASK_DEFINE(x) void *(x)(sched_task_t*) /* task lock helpers */ #define TASK_LOCK(x) ((x)->task_lock = 42) @@ -214,16 +215,11 @@ typedef TAILQ_HEAD(, sched_Task) sched_queue_t; /* root task */ struct sched_RootTask { int root_kq; -#ifndef KQ_DISABLE + fd_set root_fds[2]; struct timespec root_wait; struct timespec root_poll; -#else - fd_set root_fds[2]; - struct timeval root_wait; - struct timeval root_poll; -#endif unsigned long root_miss; - intptr_t root_cond; + intptr_t root_cond[1]; void *root_ret; pthread_mutex_t root_mtx[taskMAX]; @@ -313,7 +309,7 @@ int schedPolling(sched_root_task_t * __restrict root, * @condValue = condition value, kill schedRun() if condValue == killState * return: -1 error or 0 ok */ -int schedTermCondition(sched_root_task_t * __restrict root, intptr_t condValue); +int schedTermCondition(sched_root_task_t * __restrict root, intptr_t * __restrict condValue); /* * schedCall() - Call task execution function *