… | |
… | |
2147 | ev_io *w; |
2147 | ev_io *w; |
2148 | |
2148 | |
2149 | unsigned char o_events = anfd->events; |
2149 | unsigned char o_events = anfd->events; |
2150 | unsigned char o_reify = anfd->reify; |
2150 | unsigned char o_reify = anfd->reify; |
2151 | |
2151 | |
2152 | anfd->reify = 0; |
2152 | anfd->reify = 0; |
2153 | |
2153 | |
2154 | /*if (expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */ |
2154 | /*if (expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */ |
2155 | { |
2155 | { |
2156 | anfd->events = 0; |
2156 | anfd->events = 0; |
2157 | |
2157 | |
… | |
… | |
3923 | return; |
3923 | return; |
3924 | |
3924 | |
3925 | assert (("libev: ev_io_start called with negative fd", fd >= 0)); |
3925 | assert (("libev: ev_io_start called with negative fd", fd >= 0)); |
3926 | assert (("libev: ev_io_start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE)))); |
3926 | assert (("libev: ev_io_start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE)))); |
3927 | |
3927 | |
|
|
3928 | #if EV_VERIFY >= 2 |
|
|
3929 | assert (("libev: ev_io_start called on watcher with invalid fd", fd_valid (fd))); |
|
|
3930 | #endif |
3928 | EV_FREQUENT_CHECK; |
3931 | EV_FREQUENT_CHECK; |
3929 | |
3932 | |
3930 | ev_start (EV_A_ (W)w, 1); |
3933 | ev_start (EV_A_ (W)w, 1); |
3931 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_needsize_zerofill); |
3934 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_needsize_zerofill); |
3932 | wlist_add (&anfds[fd].head, (WL)w); |
3935 | wlist_add (&anfds[fd].head, (WL)w); |
… | |
… | |
3948 | if (expect_false (!ev_is_active (w))) |
3951 | if (expect_false (!ev_is_active (w))) |
3949 | return; |
3952 | return; |
3950 | |
3953 | |
3951 | assert (("libev: ev_io_stop called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); |
3954 | assert (("libev: ev_io_stop called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); |
3952 | |
3955 | |
|
|
3956 | #if EV_VERIFY >= 2 |
|
|
3957 | assert (("libev: ev_io_stop called on watcher with invalid fd", fd_valid (w->fd))); |
|
|
3958 | #endif |
3953 | EV_FREQUENT_CHECK; |
3959 | EV_FREQUENT_CHECK; |
3954 | |
3960 | |
3955 | wlist_del (&anfds[w->fd].head, (WL)w); |
3961 | wlist_del (&anfds[w->fd].head, (WL)w); |
3956 | ev_stop (EV_A_ (W)w); |
3962 | ev_stop (EV_A_ (W)w); |
3957 | |
3963 | |