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

Comparing libev/ev.c (file contents):
Revision 1.145 by root, Tue Nov 27 08:54:38 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);
1632} 1642}
1633 1643
1634#if EV_STAT_ENABLE 1644#if EV_STAT_ENABLE
1635 1645
1636# ifdef _WIN32 1646# ifdef _WIN32
1647# undef lstat
1637# define lstat(a,b) stat(a,b) 1648# define lstat(a,b) _stati64 (a,b)
1638# endif 1649# endif
1639 1650
1640#define DEF_STAT_INTERVAL 5.0074891 1651#define DEF_STAT_INTERVAL 5.0074891
1641#define MIN_STAT_INTERVAL 0.1074891 1652#define MIN_STAT_INTERVAL 0.1074891
1642 1653
1826 1837
1827 ev_stop (EV_A_ (W)w); 1838 ev_stop (EV_A_ (W)w);
1828} 1839}
1829#endif 1840#endif
1830 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
1831/*****************************************************************************/ 1871/*****************************************************************************/
1832 1872
1833struct ev_once 1873struct ev_once
1834{ 1874{
1835 ev_io io; 1875 ev_io io;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines