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

Comparing libev/ev.c (file contents):
Revision 1.359 by root, Sun Oct 24 17:58:41 2010 UTC vs.
Revision 1.361 by root, Sun Oct 24 19:01:01 2010 UTC

1736void 1736void
1737ev_loop_destroy (EV_P) 1737ev_loop_destroy (EV_P)
1738{ 1738{
1739 int i; 1739 int i;
1740 1740
1741#if EV_CLEANUP_ENABLE
1742 /* queue cleanup watchers (and execute them) */
1743 if (expect_false (cleanupcnt))
1744 {
1745 queue_events (EV_A_ (W *)cleanups, cleanupcnt, EV_CLEANUP);
1746 EV_INVOKE_PENDING;
1747 }
1748#endif
1749
1741#if EV_CHILD_ENABLE 1750#if EV_CHILD_ENABLE
1742 if (ev_is_active (&childev)) 1751 if (ev_is_active (&childev))
1743 { 1752 {
1744 ev_ref (EV_A); /* child watcher */ 1753 ev_ref (EV_A); /* child watcher */
1745 ev_signal_stop (EV_A_ &childev); 1754 ev_signal_stop (EV_A_ &childev);
1812#if EV_PERIODIC_ENABLE 1821#if EV_PERIODIC_ENABLE
1813 array_free (periodic, EMPTY); 1822 array_free (periodic, EMPTY);
1814#endif 1823#endif
1815#if EV_FORK_ENABLE 1824#if EV_FORK_ENABLE
1816 array_free (fork, EMPTY); 1825 array_free (fork, EMPTY);
1826#endif
1827#if EV_CLEANUP_ENABLE
1828 array_free (cleanup, EMPTY);
1817#endif 1829#endif
1818 array_free (prepare, EMPTY); 1830 array_free (prepare, EMPTY);
1819 array_free (check, EMPTY); 1831 array_free (check, EMPTY);
1820#if EV_ASYNC_ENABLE 1832#if EV_ASYNC_ENABLE
1821 array_free (async, EMPTY); 1833 array_free (async, EMPTY);
1983 } 1995 }
1984 1996
1985#if EV_FORK_ENABLE 1997#if EV_FORK_ENABLE
1986 assert (forkmax >= forkcnt); 1998 assert (forkmax >= forkcnt);
1987 array_verify (EV_A_ (W *)forks, forkcnt); 1999 array_verify (EV_A_ (W *)forks, forkcnt);
2000#endif
2001
2002#if EV_CLEANUP_ENABLE
2003 assert (cleanupmax >= cleanupcnt);
2004 array_verify (EV_A_ (W *)cleanups, cleanupcnt);
1988#endif 2005#endif
1989 2006
1990#if EV_ASYNC_ENABLE 2007#if EV_ASYNC_ENABLE
1991 assert (asyncmax >= asynccnt); 2008 assert (asyncmax >= asynccnt);
1992 array_verify (EV_A_ (W *)asyncs, asynccnt); 2009 array_verify (EV_A_ (W *)asyncs, asynccnt);
3562 3579
3563 EV_FREQUENT_CHECK; 3580 EV_FREQUENT_CHECK;
3564} 3581}
3565#endif 3582#endif
3566 3583
3584#if EV_CLEANUP_ENABLE
3585void
3586ev_cleanup_start (EV_P_ ev_cleanup *w)
3587{
3588 if (expect_false (ev_is_active (w)))
3589 return;
3590
3591 EV_FREQUENT_CHECK;
3592
3593 ev_start (EV_A_ (W)w, ++cleanupcnt);
3594 array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2);
3595 cleanups [cleanupcnt - 1] = w;
3596
3597 EV_FREQUENT_CHECK;
3598}
3599
3600void
3601ev_cleanup_stop (EV_P_ ev_cleanup *w)
3602{
3603 clear_pending (EV_A_ (W)w);
3604 if (expect_false (!ev_is_active (w)))
3605 return;
3606
3607 EV_FREQUENT_CHECK;
3608
3609 {
3610 int active = ev_active (w);
3611
3612 cleanups [active - 1] = cleanups [--cleanupcnt];
3613 ev_active (cleanups [active - 1]) = active;
3614 }
3615
3616 ev_stop (EV_A_ (W)w);
3617
3618 EV_FREQUENT_CHECK;
3619}
3620#endif
3621
3567#if EV_ASYNC_ENABLE 3622#if EV_ASYNC_ENABLE
3568void 3623void
3569ev_async_start (EV_P_ ev_async *w) 3624ev_async_start (EV_P_ ev_async *w)
3570{ 3625{
3571 if (expect_false (ev_is_active (w))) 3626 if (expect_false (ev_is_active (w)))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines