ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.349 by sf-exg, Fri Oct 15 22:59:59 2010 UTC vs.
Revision 1.350 by root, Sat Oct 16 00:59:56 2010 UTC

943 { 943 {
944 int fd = fdchanges [i]; 944 int fd = fdchanges [i];
945 ANFD *anfd = anfds + fd; 945 ANFD *anfd = anfds + fd;
946 ev_io *w; 946 ev_io *w;
947 947
948 unsigned char events = 0; 948 unsigned char o_events = anfd->events;
949 unsigned char o_reify = anfd->reify;
949 950
950 for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next) 951 anfd->reify = 0;
951 events |= (unsigned char)w->events;
952 952
953#if EV_SELECT_IS_WINSOCKET 953#if EV_SELECT_IS_WINSOCKET
954 if (events) 954 if (o_reify & EV__IOFDSET)
955 { 955 {
956 unsigned long arg; 956 unsigned long arg;
957 anfd->handle = EV_FD_TO_WIN32_HANDLE (fd); 957 anfd->handle = EV_FD_TO_WIN32_HANDLE (fd);
958 assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0)); 958 assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0));
959 } 959 }
960#endif 960#endif
961 961
962 /*if (expect_true (o_reify & EV_ANFD_REIFY)) probably a deoptimisation */
962 { 963 {
963 unsigned char o_events = anfd->events;
964 unsigned char o_reify = anfd->reify;
965
966 anfd->reify = 0;
967 anfd->events = events; 964 anfd->events = 0;
968 965
969 if (o_events != events || o_reify & EV__IOFDSET) 966 for (w = (ev_io *)anfd->head; w; w = (ev_io *)((WL)w)->next)
967 anfd->events |= (unsigned char)w->events;
968
969 if (o_events !=anfd-> events)
970 o_reify = EV__IOFDSET; /* actually |= */
971 }
972
973 if (o_reify & EV__IOFDSET)
970 backend_modify (EV_A_ fd, o_events, events); 974 backend_modify (EV_A_ fd, o_events, anfd->events);
971 }
972 } 975 }
973 976
974 fdchangecnt = 0; 977 fdchangecnt = 0;
975} 978}
976 979
2597 EV_FREQUENT_CHECK; 2600 EV_FREQUENT_CHECK;
2598 2601
2599 wlist_del (&anfds[w->fd].head, (WL)w); 2602 wlist_del (&anfds[w->fd].head, (WL)w);
2600 ev_stop (EV_A_ (W)w); 2603 ev_stop (EV_A_ (W)w);
2601 2604
2602 fd_change (EV_A_ w->fd, 1); 2605 fd_change (EV_A_ w->fd, EV_ANFD_REIFY);
2603 2606
2604 EV_FREQUENT_CHECK; 2607 EV_FREQUENT_CHECK;
2605} 2608}
2606 2609
2607void noinline 2610void noinline

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines