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.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);
1632} 1640}
1633 1641
1634#if EV_STAT_ENABLE 1642#if EV_STAT_ENABLE
1635 1643
1636# ifdef _WIN32 1644# ifdef _WIN32
1645# undef lstat
1637# define lstat(a,b) stat(a,b) 1646# define lstat(a,b) _stati64 (a,b)
1638# endif 1647# endif
1639 1648
1640#define DEF_STAT_INTERVAL 5.0074891 1649#define DEF_STAT_INTERVAL 5.0074891
1641#define MIN_STAT_INTERVAL 0.1074891 1650#define MIN_STAT_INTERVAL 0.1074891
1642 1651
1826 1835
1827 ev_stop (EV_A_ (W)w); 1836 ev_stop (EV_A_ (W)w);
1828} 1837}
1829#endif 1838#endif
1830 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
1831/*****************************************************************************/ 1869/*****************************************************************************/
1832 1870
1833struct ev_once 1871struct ev_once
1834{ 1872{
1835 ev_io io; 1873 ev_io io;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines