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.148 by root, Tue Nov 27 11:11:13 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 EV_FORK_ENABLE
1283 if (expect_false (postfork))
1284 if (forkcnt)
1285 {
1286 queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK);
1287 call_pending (EV_A);
1288 }
1289 #endif
1290
1281 /* queue check watchers (and execute them) */ 1291 /* queue check watchers (and execute them) */
1282 if (expect_false (preparecnt)) 1292 if (expect_false (preparecnt))
1283 { 1293 {
1284 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); 1294 queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE);
1285 call_pending (EV_A); 1295 call_pending (EV_A);
1827 1837
1828 ev_stop (EV_A_ (W)w); 1838 ev_stop (EV_A_ (W)w);
1829} 1839}
1830#endif 1840#endif
1831 1841
1842#if EV_FORK_ENABLE
1843void
1844ev_fork_start (EV_P_ ev_fork *w)
1845{
1846 if (expect_false (ev_is_active (w)))
1847 return;
1848
1849 ev_start (EV_A_ (W)w, ++forkcnt);
1850 array_needsize (ev_fork *, forks, forkmax, forkcnt, EMPTY2);
1851 forks [forkcnt - 1] = w;
1852}
1853
1854void
1855ev_fork_stop (EV_P_ ev_fork *w)
1856{
1857 ev_clear_pending (EV_A_ (W)w);
1858 if (expect_false (!ev_is_active (w)))
1859 return;
1860
1861 {
1862 int active = ((W)w)->active;
1863 forks [active - 1] = forks [--forkcnt];
1864 ((W)forks [active - 1])->active = active;
1865 }
1866
1867 ev_stop (EV_A_ (W)w);
1868}
1869#endif
1870
1832/*****************************************************************************/ 1871/*****************************************************************************/
1833 1872
1834struct ev_once 1873struct ev_once
1835{ 1874{
1836 ev_io io; 1875 ev_io io;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines