- /** Initial value before any pre_select call. */
- struct timeval default_timeout;
- /** The current timeout for the upcoming select call. */
- struct timeval select_timeout;
- /** fds that should be watched for readability. */
- fd_set rfds;
- /** fds that should be watched for writability. */
- fd_set wfds;
- /** Highest numbered file descriptor in any of the above fd sets. */
- int max_fileno;
- /** If non-NULL, use this function instead of para_select. */
- int (*select_function)(int, fd_set *, fd_set *, struct timeval *);
- /** Currently active pre_select functions. */
- struct list_head pre_select_list;
- /** Currently active post_select functions. */
- struct list_head post_select_list;
+ /** Initial value (in milliseconds) before any pre_monitor call. */
+ int default_timeout;
+ /** The timeout (also in milliseconds) for the next iteration. */
+ int timeout;
+ /** Passed to poll(2). */
+ struct pollfd *pfd;
+ /** Number of elements in the above array, passed to poll(2). */
+ unsigned pfd_array_len;
+ /** Number of fds registered for montitoring so far. */
+ unsigned num_pfds;
+ /** Maps fds to indices of the pfd array. */
+ unsigned *pidx;
+ /** Mumber of elements in the above pidx array. */
+ unsigned pidx_array_len;
+ /** If non-NULL, use this function instead of \ref xpoll(). */
+ int (*poll_function)(struct pollfd *fds, nfds_t nfds, int timeout);
+ /** Tasks which have been registered to the scheduler. */
+ struct list_head task_list;