--- libaitsched/inc/aitsched.h 2014/01/27 15:01:52 1.24.2.1 +++ libaitsched/inc/aitsched.h 2014/03/05 20:40:22 1.25.4.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsched.h,v 1.24.2.1 2014/01/27 15:01:52 misho Exp $ +* $Id: aitsched.h,v 1.25.4.1 2014/03/05 20:40:22 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 @@ -49,9 +49,7 @@ SUCH DAMAGE. #include #include -#ifndef KQ_DISABLE -#include -#endif +#include #include #include #include @@ -162,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) @@ -196,6 +195,9 @@ struct sched_Task { #define TASK_FD(x) (x)->task_val.fd #define TASK_TS(x) (x)->task_val.ts +#define TASK_TS2TV(x, tvp) (assert((tvp)), (tvp)->tv_sec = (x)->task_val.ts.tv_sec, \ + (tvp)->tv_usec = (x)->task_val.ts.tv_nsec / 1000) + struct iovec task_data; #define TASK_DATA(x) (x)->task_data.iov_base #define TASK_DATLEN(x) (x)->task_data.iov_len @@ -213,10 +215,10 @@ typedef TAILQ_HEAD(, sched_Task) sched_queue_t; /* root task */ struct sched_RootTask { int root_kq; - fd_set root_fds; - unsigned long root_miss; + fd_set root_fds[2]; struct timespec root_wait; struct timespec root_poll; + unsigned long root_miss; intptr_t root_cond; void *root_ret;