*** empty log message ***

This commit is contained in:
Marc Alexander Lehmann 2010-10-24 18:12:41 +00:00
parent 32e5f700c3
commit 0018d3e076
1 changed files with 46 additions and 0 deletions

46
ev.c
View File

@ -1814,6 +1814,9 @@ ev_loop_destroy (EV_P)
#endif
#if EV_FORK_ENABLE
array_free (fork, EMPTY);
#endif
#if EV_CLEANUP_ENABLE
array_free (cleanup, EMPTY);
#endif
array_free (prepare, EMPTY);
array_free (check, EMPTY);
@ -1987,6 +1990,11 @@ ev_verify (EV_P)
array_verify (EV_A_ (W *)forks, forkcnt);
#endif
#if EV_CLEANUP_ENABLE
assert (cleanupmax >= cleanupcnt);
array_verify (EV_A_ (W *)cleanups, cleanupcnt);
#endif
#if EV_ASYNC_ENABLE
assert (asyncmax >= asynccnt);
array_verify (EV_A_ (W *)asyncs, asynccnt);
@ -3564,6 +3572,44 @@ ev_fork_stop (EV_P_ ev_fork *w)
}
#endif
#if EV_CLEANUP_ENABLE
void
ev_cleanup_start (EV_P_ ev_cleanup *w)
{
if (expect_false (ev_is_active (w)))
return;
EV_FREQUENT_CHECK;
ev_start (EV_A_ (W)w, ++cleanupcnt);
array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2);
cleanups [cleanupcnt - 1] = w;
EV_FREQUENT_CHECK;
}
void
ev_cleanup_stop (EV_P_ ev_cleanup *w)
{
clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w)))
return;
EV_FREQUENT_CHECK;
{
int active = ev_active (w);
cleanups [active - 1] = cleanups [--cleanupcnt];
ev_active (cleanups [active - 1]) = active;
}
ev_stop (EV_A_ (W)w);
EV_FREQUENT_CHECK;
}
#endif
#if EV_ASYNC_ENABLE
void
ev_async_start (EV_P_ ev_async *w)