… | |
… | |
2554 | #if EV_FEATURE_API |
2554 | #if EV_FEATURE_API |
2555 | void ecb_cold |
2555 | void ecb_cold |
2556 | ev_verify (EV_P) EV_THROW |
2556 | ev_verify (EV_P) EV_THROW |
2557 | { |
2557 | { |
2558 | #if EV_VERIFY |
2558 | #if EV_VERIFY |
2559 | int i; |
2559 | int i, j; |
2560 | WL w; |
2560 | WL w, w2; |
2561 | |
2561 | |
2562 | assert (activecnt >= -1); |
2562 | assert (activecnt >= -1); |
2563 | |
2563 | |
2564 | assert (fdchangemax >= fdchangecnt); |
2564 | assert (fdchangemax >= fdchangecnt); |
2565 | for (i = 0; i < fdchangecnt; ++i) |
2565 | for (i = 0; i < fdchangecnt; ++i) |
2566 | assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0)); |
2566 | assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0)); |
2567 | |
2567 | |
2568 | assert (anfdmax >= 0); |
2568 | assert (anfdmax >= 0); |
2569 | for (i = 0; i < anfdmax; ++i) |
2569 | for (i = j = 0; i < anfdmax; ++i) |
2570 | for (w = anfds [i].head; w; w = w->next) |
2570 | for (w = w2 = anfds [i].head; w; w = w->next) |
2571 | { |
2571 | { |
2572 | verify_watcher (EV_A_ (W)w); |
2572 | verify_watcher (EV_A_ (W)w); |
|
|
2573 | |
|
|
2574 | if (++j & 1) |
|
|
2575 | w2 = w2->next; |
|
|
2576 | |
|
|
2577 | assert (("libev: io watcher list contains a loop", w != w2)); |
2573 | assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); |
2578 | assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); |
2574 | assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); |
2579 | assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); |
2575 | } |
2580 | } |
2576 | |
2581 | |
2577 | assert (timermax >= timercnt); |
2582 | assert (timermax >= timercnt); |
… | |
… | |
3249 | EV_FREQUENT_CHECK; |
3254 | EV_FREQUENT_CHECK; |
3250 | |
3255 | |
3251 | ev_start (EV_A_ (W)w, 1); |
3256 | ev_start (EV_A_ (W)w, 1); |
3252 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero); |
3257 | array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero); |
3253 | wlist_add (&anfds[fd].head, (WL)w); |
3258 | wlist_add (&anfds[fd].head, (WL)w); |
|
|
3259 | |
|
|
3260 | /* common bug, apparently */ |
|
|
3261 | assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w)); |
3254 | |
3262 | |
3255 | fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); |
3263 | fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); |
3256 | w->events &= ~EV__IOFDSET; |
3264 | w->events &= ~EV__IOFDSET; |
3257 | |
3265 | |
3258 | EV_FREQUENT_CHECK; |
3266 | EV_FREQUENT_CHECK; |