… | |
… | |
1813 | array_free (periodic, EMPTY); |
1813 | array_free (periodic, EMPTY); |
1814 | #endif |
1814 | #endif |
1815 | #if EV_FORK_ENABLE |
1815 | #if EV_FORK_ENABLE |
1816 | array_free (fork, EMPTY); |
1816 | array_free (fork, EMPTY); |
1817 | #endif |
1817 | #endif |
|
|
1818 | #if EV_CLEANUP_ENABLE |
|
|
1819 | array_free (cleanup, EMPTY); |
|
|
1820 | #endif |
1818 | array_free (prepare, EMPTY); |
1821 | array_free (prepare, EMPTY); |
1819 | array_free (check, EMPTY); |
1822 | array_free (check, EMPTY); |
1820 | #if EV_ASYNC_ENABLE |
1823 | #if EV_ASYNC_ENABLE |
1821 | array_free (async, EMPTY); |
1824 | array_free (async, EMPTY); |
1822 | #endif |
1825 | #endif |
… | |
… | |
1983 | } |
1986 | } |
1984 | |
1987 | |
1985 | #if EV_FORK_ENABLE |
1988 | #if EV_FORK_ENABLE |
1986 | assert (forkmax >= forkcnt); |
1989 | assert (forkmax >= forkcnt); |
1987 | array_verify (EV_A_ (W *)forks, forkcnt); |
1990 | array_verify (EV_A_ (W *)forks, forkcnt); |
|
|
1991 | #endif |
|
|
1992 | |
|
|
1993 | #if EV_CLEANUP_ENABLE |
|
|
1994 | assert (cleanupmax >= cleanupcnt); |
|
|
1995 | array_verify (EV_A_ (W *)cleanups, cleanupcnt); |
1988 | #endif |
1996 | #endif |
1989 | |
1997 | |
1990 | #if EV_ASYNC_ENABLE |
1998 | #if EV_ASYNC_ENABLE |
1991 | assert (asyncmax >= asynccnt); |
1999 | assert (asyncmax >= asynccnt); |
1992 | array_verify (EV_A_ (W *)asyncs, asynccnt); |
2000 | array_verify (EV_A_ (W *)asyncs, asynccnt); |
… | |
… | |
3562 | |
3570 | |
3563 | EV_FREQUENT_CHECK; |
3571 | EV_FREQUENT_CHECK; |
3564 | } |
3572 | } |
3565 | #endif |
3573 | #endif |
3566 | |
3574 | |
|
|
3575 | #if EV_CLEANUP_ENABLE |
|
|
3576 | void |
|
|
3577 | ev_cleanup_start (EV_P_ ev_cleanup *w) |
|
|
3578 | { |
|
|
3579 | if (expect_false (ev_is_active (w))) |
|
|
3580 | return; |
|
|
3581 | |
|
|
3582 | EV_FREQUENT_CHECK; |
|
|
3583 | |
|
|
3584 | ev_start (EV_A_ (W)w, ++cleanupcnt); |
|
|
3585 | array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2); |
|
|
3586 | cleanups [cleanupcnt - 1] = w; |
|
|
3587 | |
|
|
3588 | EV_FREQUENT_CHECK; |
|
|
3589 | } |
|
|
3590 | |
|
|
3591 | void |
|
|
3592 | ev_cleanup_stop (EV_P_ ev_cleanup *w) |
|
|
3593 | { |
|
|
3594 | clear_pending (EV_A_ (W)w); |
|
|
3595 | if (expect_false (!ev_is_active (w))) |
|
|
3596 | return; |
|
|
3597 | |
|
|
3598 | EV_FREQUENT_CHECK; |
|
|
3599 | |
|
|
3600 | { |
|
|
3601 | int active = ev_active (w); |
|
|
3602 | |
|
|
3603 | cleanups [active - 1] = cleanups [--cleanupcnt]; |
|
|
3604 | ev_active (cleanups [active - 1]) = active; |
|
|
3605 | } |
|
|
3606 | |
|
|
3607 | ev_stop (EV_A_ (W)w); |
|
|
3608 | |
|
|
3609 | EV_FREQUENT_CHECK; |
|
|
3610 | } |
|
|
3611 | #endif |
|
|
3612 | |
3567 | #if EV_ASYNC_ENABLE |
3613 | #if EV_ASYNC_ENABLE |
3568 | void |
3614 | void |
3569 | ev_async_start (EV_P_ ev_async *w) |
3615 | ev_async_start (EV_P_ ev_async *w) |
3570 | { |
3616 | { |
3571 | if (expect_false (ev_is_active (w))) |
3617 | if (expect_false (ev_is_active (w))) |