… | |
… | |
676 | fprintf (stderr, "slimmed down " # stem " to %d\n", stem ## max);/*D*/\ |
676 | fprintf (stderr, "slimmed down " # stem " to %d\n", stem ## max);/*D*/\ |
677 | } |
677 | } |
678 | #endif |
678 | #endif |
679 | |
679 | |
680 | #define array_free(stem, idx) \ |
680 | #define array_free(stem, idx) \ |
681 | ev_free (stem ## s idx); stem ## cnt idx = stem ## max idx = 0; |
681 | ev_free (stem ## s idx); stem ## cnt idx = stem ## max idx = 0; stem ## s idx = 0 |
682 | |
682 | |
683 | /*****************************************************************************/ |
683 | /*****************************************************************************/ |
684 | |
684 | |
685 | void noinline |
685 | void noinline |
686 | ev_feed_event (EV_P_ void *w, int revents) |
686 | ev_feed_event (EV_P_ void *w, int revents) |
… | |
… | |
766 | unsigned char o_reify = anfd->reify; |
766 | unsigned char o_reify = anfd->reify; |
767 | |
767 | |
768 | anfd->reify = 0; |
768 | anfd->reify = 0; |
769 | anfd->events = events; |
769 | anfd->events = events; |
770 | |
770 | |
771 | if (o_events != events || o_reify & EV_IOFDSET) |
771 | if (o_events != events || o_reify & EV__IOFDSET) |
772 | backend_modify (EV_A_ fd, o_events, events); |
772 | backend_modify (EV_A_ fd, o_events, events); |
773 | } |
773 | } |
774 | } |
774 | } |
775 | |
775 | |
776 | fdchangecnt = 0; |
776 | fdchangecnt = 0; |
… | |
… | |
847 | for (fd = 0; fd < anfdmax; ++fd) |
847 | for (fd = 0; fd < anfdmax; ++fd) |
848 | if (anfds [fd].events) |
848 | if (anfds [fd].events) |
849 | { |
849 | { |
850 | anfds [fd].events = 0; |
850 | anfds [fd].events = 0; |
851 | anfds [fd].emask = 0; |
851 | anfds [fd].emask = 0; |
852 | fd_change (EV_A_ fd, EV_IOFDSET | 1); |
852 | fd_change (EV_A_ fd, EV__IOFDSET | 1); |
853 | } |
853 | } |
854 | } |
854 | } |
855 | |
855 | |
856 | /*****************************************************************************/ |
856 | /*****************************************************************************/ |
857 | |
857 | |
… | |
… | |
2174 | |
2174 | |
2175 | if (expect_false (ev_is_active (w))) |
2175 | if (expect_false (ev_is_active (w))) |
2176 | return; |
2176 | return; |
2177 | |
2177 | |
2178 | assert (("libev: ev_io_start called with negative fd", fd >= 0)); |
2178 | assert (("libev: ev_io_start called with negative fd", fd >= 0)); |
2179 | assert (("libev: ev_io start called with illegal event mask", !(w->events & ~(EV_IOFDSET | EV_READ | EV_WRITE)))); |
2179 | assert (("libev: ev_io start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE)))); |
2180 | |
2180 | |
2181 | EV_FREQUENT_CHECK; |
2181 | EV_FREQUENT_CHECK; |
2182 | |
2182 | |
2183 | ev_start (EV_A_ (W)w, 1); |
2183 | ev_start (EV_A_ (W)w, 1); |
2184 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero); |
2184 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero); |
2185 | wlist_add (&anfds[fd].head, (WL)w); |
2185 | wlist_add (&anfds[fd].head, (WL)w); |
2186 | |
2186 | |
2187 | fd_change (EV_A_ fd, w->events & EV_IOFDSET | 1); |
2187 | fd_change (EV_A_ fd, w->events & EV__IOFDSET | 1); |
2188 | w->events &= ~EV_IOFDSET; |
2188 | w->events &= ~EV__IOFDSET; |
2189 | |
2189 | |
2190 | EV_FREQUENT_CHECK; |
2190 | EV_FREQUENT_CHECK; |
2191 | } |
2191 | } |
2192 | |
2192 | |
2193 | void noinline |
2193 | void noinline |