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

Comparing libev/ev.c (file contents):
Revision 1.146 by root, Tue Nov 27 09:17:51 2007 UTC vs.
Revision 1.147 by root, Tue Nov 27 10:59:11 2007 UTC

1276 ? EVUNLOOP_ONE 1276 ? EVUNLOOP_ONE
1277 : EVUNLOOP_CANCEL; 1277 : EVUNLOOP_CANCEL;
1278 1278
1279 while (activecnt) 1279 while (activecnt)
1280 { 1280 {
1281 /* we might have forked, so reify kernel state if necessary */
1282 if (expect_false (postfork))
1283 if (forkcnt)
1284 {
1285 queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK);
1286 call_pending (EV_A);
1287 }
1288
1281 /* queue check watchers (and execute them) */ 1289 /* queue check watchers (and execute them) */
1282 if (expect_false (preparecnt)) 1290 if (expect_false (preparecnt))
1283 { 1291 {
1284 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); 1292 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE);
1285 call_pending (EV_A); 1293 call_pending (EV_A);
1827 1835
1828 ev_stop (EV_A_ (W)w); 1836 ev_stop (EV_A_ (W)w);
1829} 1837}
1830#endif 1838#endif
1831 1839
1840#if EV_FORK_ENABLE
1841void
1842ev_fork_start (EV_P_ ev_fork *w)
1843{
1844 if (expect_false (ev_is_active (w)))
1845 return;
1846
1847 ev_start (EV_A_ (W)w, ++forkcnt);
1848 array_needsize (ev_fork *, forks, forkmax, forkcnt, EMPTY2);
1849 forks [forkcnt - 1] = w;
1850}
1851
1852void
1853ev_fork_stop (EV_P_ ev_fork *w)
1854{
1855 ev_clear_pending (EV_A_ (W)w);
1856 if (expect_false (!ev_is_active (w)))
1857 return;
1858
1859 {
1860 int active = ((W)w)->active;
1861 forks [active - 1] = forks [--forkcnt];
1862 ((W)forks [active - 1])->active = active;
1863 }
1864
1865 ev_stop (EV_A_ (W)w);
1866}
1867#endif
1868
1832/*****************************************************************************/ 1869/*****************************************************************************/
1833 1870
1834struct ev_once 1871struct ev_once
1835{ 1872{
1836 ev_io io; 1873 ev_io io;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines