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

Comparing libev/ev.c (file contents):
Revision 1.177 by root, Tue Dec 11 15:06:50 2007 UTC vs.
Revision 1.182 by root, Wed Dec 12 01:27:08 2007 UTC

476 pendings [pri][w_->pending - 1].w = w_; 476 pendings [pri][w_->pending - 1].w = w_;
477 pendings [pri][w_->pending - 1].events = revents; 477 pendings [pri][w_->pending - 1].events = revents;
478 } 478 }
479} 479}
480 480
481void inline_size 481void inline_speed
482queue_events (EV_P_ W *events, int eventcnt, int type) 482queue_events (EV_P_ W *events, int eventcnt, int type)
483{ 483{
484 int i; 484 int i;
485 485
486 for (i = 0; i < eventcnt; ++i) 486 for (i = 0; i < eventcnt; ++i)
638void inline_speed 638void inline_speed
639upheap (WT *heap, int k) 639upheap (WT *heap, int k)
640{ 640{
641 WT w = heap [k]; 641 WT w = heap [k];
642 642
643 while (k && heap [k >> 1]->at > w->at) 643 while (k)
644 { 644 {
645 int p = (k - 1) >> 1;
646
647 if (heap [p]->at <= w->at)
648 break;
649
645 heap [k] = heap [k >> 1]; 650 heap [k] = heap [p];
646 ((W)heap [k])->active = k + 1; 651 ((W)heap [k])->active = k + 1;
647 k >>= 1; 652 k = p;
648 } 653 }
649 654
650 heap [k] = w; 655 heap [k] = w;
651 ((W)heap [k])->active = k + 1; 656 ((W)heap [k])->active = k + 1;
652
653} 657}
654 658
655void inline_speed 659void inline_speed
656downheap (WT *heap, int N, int k) 660downheap (WT *heap, int N, int k)
657{ 661{
658 WT w = heap [k]; 662 WT w = heap [k];
659 663
660 while (k < (N >> 1)) 664 for (;;)
661 { 665 {
662 int j = k << 1; 666 int c = (k << 1) + 1;
663 667
664 if (j + 1 < N && heap [j]->at > heap [j + 1]->at) 668 if (c >= N)
665 ++j;
666
667 if (w->at <= heap [j]->at)
668 break; 669 break;
669 670
671 c += c + 1 < N && heap [c]->at > heap [c + 1]->at
672 ? 1 : 0;
673
674 if (w->at <= heap [c]->at)
675 break;
676
670 heap [k] = heap [j]; 677 heap [k] = heap [c];
671 ((W)heap [k])->active = k + 1; 678 ((W)heap [k])->active = k + 1;
679
672 k = j; 680 k = c;
673 } 681 }
674 682
675 heap [k] = w; 683 heap [k] = w;
676 ((W)heap [k])->active = k + 1; 684 ((W)heap [k])->active = k + 1;
677} 685}
784 ev_unref (EV_A); /* child watcher should not keep loop alive */ 792 ev_unref (EV_A); /* child watcher should not keep loop alive */
785} 793}
786 794
787/*****************************************************************************/ 795/*****************************************************************************/
788 796
789static ev_child *childs [EV_PID_HASHSIZE]; 797static WL childs [EV_PID_HASHSIZE];
790 798
791#ifndef _WIN32 799#ifndef _WIN32
792 800
793static ev_signal childev; 801static ev_signal childev;
794 802
1206void inline_size 1214void inline_size
1207timers_reify (EV_P) 1215timers_reify (EV_P)
1208{ 1216{
1209 while (timercnt && ((WT)timers [0])->at <= mn_now) 1217 while (timercnt && ((WT)timers [0])->at <= mn_now)
1210 { 1218 {
1211 ev_timer *w = timers [0]; 1219 ev_timer *w = (ev_timer *)timers [0];
1212 1220
1213 /*assert (("inactive timer on timer heap detected", ev_is_active (w)));*/ 1221 /*assert (("inactive timer on timer heap detected", ev_is_active (w)));*/
1214 1222
1215 /* first reschedule or stop timer */ 1223 /* first reschedule or stop timer */
1216 if (w->repeat) 1224 if (w->repeat)
1219 1227
1220 ((WT)w)->at += w->repeat; 1228 ((WT)w)->at += w->repeat;
1221 if (((WT)w)->at < mn_now) 1229 if (((WT)w)->at < mn_now)
1222 ((WT)w)->at = mn_now; 1230 ((WT)w)->at = mn_now;
1223 1231
1224 downheap ((WT *)timers, timercnt, 0); 1232 downheap (timers, timercnt, 0);
1225 } 1233 }
1226 else 1234 else
1227 ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ 1235 ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */
1228 1236
1229 ev_feed_event (EV_A_ (W)w, EV_TIMEOUT); 1237 ev_feed_event (EV_A_ (W)w, EV_TIMEOUT);
1234void inline_size 1242void inline_size
1235periodics_reify (EV_P) 1243periodics_reify (EV_P)
1236{ 1244{
1237 while (periodiccnt && ((WT)periodics [0])->at <= ev_rt_now) 1245 while (periodiccnt && ((WT)periodics [0])->at <= ev_rt_now)
1238 { 1246 {
1239 ev_periodic *w = periodics [0]; 1247 ev_periodic *w = (ev_periodic *)periodics [0];
1240 1248
1241 /*assert (("inactive timer on periodic heap detected", ev_is_active (w)));*/ 1249 /*assert (("inactive timer on periodic heap detected", ev_is_active (w)));*/
1242 1250
1243 /* first reschedule or stop timer */ 1251 /* first reschedule or stop timer */
1244 if (w->reschedule_cb) 1252 if (w->reschedule_cb)
1245 { 1253 {
1246 ((WT)w)->at = w->reschedule_cb (w, ev_rt_now + TIME_EPSILON); 1254 ((WT)w)->at = w->reschedule_cb (w, ev_rt_now + TIME_EPSILON);
1247 assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); 1255 assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now));
1248 downheap ((WT *)periodics, periodiccnt, 0); 1256 downheap (periodics, periodiccnt, 0);
1249 } 1257 }
1250 else if (w->interval) 1258 else if (w->interval)
1251 { 1259 {
1252 ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; 1260 ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
1253 if (((WT)w)->at - ev_rt_now <= TIME_EPSILON) ((WT)w)->at += w->interval; 1261 if (((WT)w)->at - ev_rt_now <= TIME_EPSILON) ((WT)w)->at += w->interval;
1254 assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); 1262 assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now));
1255 downheap ((WT *)periodics, periodiccnt, 0); 1263 downheap (periodics, periodiccnt, 0);
1256 } 1264 }
1257 else 1265 else
1258 ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ 1266 ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */
1259 1267
1260 ev_feed_event (EV_A_ (W)w, EV_PERIODIC); 1268 ev_feed_event (EV_A_ (W)w, EV_PERIODIC);
1267 int i; 1275 int i;
1268 1276
1269 /* adjust periodics after time jump */ 1277 /* adjust periodics after time jump */
1270 for (i = 0; i < periodiccnt; ++i) 1278 for (i = 0; i < periodiccnt; ++i)
1271 { 1279 {
1272 ev_periodic *w = periodics [i]; 1280 ev_periodic *w = (ev_periodic *)periodics [i];
1273 1281
1274 if (w->reschedule_cb) 1282 if (w->reschedule_cb)
1275 ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); 1283 ((WT)w)->at = w->reschedule_cb (w, ev_rt_now);
1276 else if (w->interval) 1284 else if (w->interval)
1277 ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; 1285 ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval;
1278 } 1286 }
1279 1287
1280 /* now rebuild the heap */ 1288 /* now rebuild the heap */
1281 for (i = periodiccnt >> 1; i--; ) 1289 for (i = periodiccnt >> 1; i--; )
1282 downheap ((WT *)periodics, periodiccnt, i); 1290 downheap (periodics, periodiccnt, i);
1283} 1291}
1284#endif 1292#endif
1285 1293
1286#if EV_IDLE_ENABLE 1294#if EV_IDLE_ENABLE
1287void inline_size 1295void inline_size
1304 } 1312 }
1305 } 1313 }
1306} 1314}
1307#endif 1315#endif
1308 1316
1309int inline_size 1317void inline_speed
1310time_update_monotonic (EV_P) 1318time_update (EV_P_ ev_tstamp max_block)
1311{ 1319{
1320 int i;
1321
1322#if EV_USE_MONOTONIC
1323 if (expect_true (have_monotonic))
1324 {
1325 ev_tstamp odiff = rtmn_diff;
1326
1312 mn_now = get_clock (); 1327 mn_now = get_clock ();
1313 1328
1329 /* only fetch the realtime clock every 0.5*MIN_TIMEJUMP seconds */
1330 /* interpolate in the meantime */
1314 if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) 1331 if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5))
1315 { 1332 {
1316 ev_rt_now = rtmn_diff + mn_now; 1333 ev_rt_now = rtmn_diff + mn_now;
1317 return 0; 1334 return;
1318 } 1335 }
1319 else 1336
1320 {
1321 now_floor = mn_now; 1337 now_floor = mn_now;
1322 ev_rt_now = ev_time (); 1338 ev_rt_now = ev_time ();
1323 return 1;
1324 }
1325}
1326 1339
1327void inline_size 1340 /* loop a few times, before making important decisions.
1328time_update (EV_P) 1341 * on the choice of "4": one iteration isn't enough,
1329{ 1342 * in case we get preempted during the calls to
1330 int i; 1343 * ev_time and get_clock. a second call is almost guaranteed
1331 1344 * to succeed in that case, though. and looping a few more times
1332#if EV_USE_MONOTONIC 1345 * doesn't hurt either as we only do this on time-jumps or
1333 if (expect_true (have_monotonic)) 1346 * in the unlikely event of having been preempted here.
1334 { 1347 */
1335 if (time_update_monotonic (EV_A)) 1348 for (i = 4; --i; )
1336 { 1349 {
1337 ev_tstamp odiff = rtmn_diff;
1338
1339 /* loop a few times, before making important decisions.
1340 * on the choice of "4": one iteration isn't enough,
1341 * in case we get preempted during the calls to
1342 * ev_time and get_clock. a second call is almost guaranteed
1343 * to succeed in that case, though. and looping a few more times
1344 * doesn't hurt either as we only do this on time-jumps or
1345 * in the unlikely event of having been preempted here.
1346 */
1347 for (i = 4; --i; )
1348 {
1349 rtmn_diff = ev_rt_now - mn_now; 1350 rtmn_diff = ev_rt_now - mn_now;
1350 1351
1351 if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) 1352 if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP)
1352 return; /* all is well */ 1353 return; /* all is well */
1353 1354
1354 ev_rt_now = ev_time (); 1355 ev_rt_now = ev_time ();
1355 mn_now = get_clock (); 1356 mn_now = get_clock ();
1356 now_floor = mn_now; 1357 now_floor = mn_now;
1357 } 1358 }
1358 1359
1359# if EV_PERIODIC_ENABLE 1360# if EV_PERIODIC_ENABLE
1360 periodics_reschedule (EV_A); 1361 periodics_reschedule (EV_A);
1361# endif 1362# endif
1362 /* no timer adjustment, as the monotonic clock doesn't jump */ 1363 /* no timer adjustment, as the monotonic clock doesn't jump */
1363 /* timers_reschedule (EV_A_ rtmn_diff - odiff) */ 1364 /* timers_reschedule (EV_A_ rtmn_diff - odiff) */
1364 }
1365 } 1365 }
1366 else 1366 else
1367#endif 1367#endif
1368 { 1368 {
1369 ev_rt_now = ev_time (); 1369 ev_rt_now = ev_time ();
1370 1370
1371 if (expect_false (mn_now > ev_rt_now || mn_now < ev_rt_now - MAX_BLOCKTIME - MIN_TIMEJUMP)) 1371 if (expect_false (mn_now > ev_rt_now || ev_rt_now > mn_now + max_block + MIN_TIMEJUMP))
1372 { 1372 {
1373#if EV_PERIODIC_ENABLE 1373#if EV_PERIODIC_ENABLE
1374 periodics_reschedule (EV_A); 1374 periodics_reschedule (EV_A);
1375#endif 1375#endif
1376 /* adjust timers. this is easy, as the offset is the same for all of them */ 1376 /* adjust timers. this is easy, as the offset is the same for all of them */
1450 if (expect_false (flags & EVLOOP_NONBLOCK || idleall || !activecnt)) 1450 if (expect_false (flags & EVLOOP_NONBLOCK || idleall || !activecnt))
1451 block = 0.; /* do not block at all */ 1451 block = 0.; /* do not block at all */
1452 else 1452 else
1453 { 1453 {
1454 /* update time to cancel out callback processing overhead */ 1454 /* update time to cancel out callback processing overhead */
1455#if EV_USE_MONOTONIC
1456 if (expect_true (have_monotonic))
1457 time_update_monotonic (EV_A); 1455 time_update (EV_A_ 1e100);
1458 else
1459#endif
1460 {
1461 ev_rt_now = ev_time ();
1462 mn_now = ev_rt_now;
1463 }
1464 1456
1465 block = MAX_BLOCKTIME; 1457 block = MAX_BLOCKTIME;
1466 1458
1467 if (timercnt) 1459 if (timercnt)
1468 { 1460 {
1481 if (expect_false (block < 0.)) block = 0.; 1473 if (expect_false (block < 0.)) block = 0.;
1482 } 1474 }
1483 1475
1484 ++loop_count; 1476 ++loop_count;
1485 backend_poll (EV_A_ block); 1477 backend_poll (EV_A_ block);
1478
1479 /* update ev_rt_now, do magic */
1480 time_update (EV_A_ block);
1486 } 1481 }
1487
1488 /* update ev_rt_now, do magic */
1489 time_update (EV_A);
1490 1482
1491 /* queue pending timers and reschedule them */ 1483 /* queue pending timers and reschedule them */
1492 timers_reify (EV_A); /* relative timers called last */ 1484 timers_reify (EV_A); /* relative timers called last */
1493#if EV_PERIODIC_ENABLE 1485#if EV_PERIODIC_ENABLE
1494 periodics_reify (EV_A); /* absolute timers called first */ 1486 periodics_reify (EV_A); /* absolute timers called first */
1605 1597
1606 assert (("ev_io_start called with negative fd", fd >= 0)); 1598 assert (("ev_io_start called with negative fd", fd >= 0));
1607 1599
1608 ev_start (EV_A_ (W)w, 1); 1600 ev_start (EV_A_ (W)w, 1);
1609 array_needsize (ANFD, anfds, anfdmax, fd + 1, anfds_init); 1601 array_needsize (ANFD, anfds, anfdmax, fd + 1, anfds_init);
1610 wlist_add ((WL *)&anfds[fd].head, (WL)w); 1602 wlist_add (&anfds[fd].head, (WL)w);
1611 1603
1612 fd_change (EV_A_ fd); 1604 fd_change (EV_A_ fd);
1613} 1605}
1614 1606
1615void noinline 1607void noinline
1619 if (expect_false (!ev_is_active (w))) 1611 if (expect_false (!ev_is_active (w)))
1620 return; 1612 return;
1621 1613
1622 assert (("ev_io_start called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax)); 1614 assert (("ev_io_start called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax));
1623 1615
1624 wlist_del ((WL *)&anfds[w->fd].head, (WL)w); 1616 wlist_del (&anfds[w->fd].head, (WL)w);
1625 ev_stop (EV_A_ (W)w); 1617 ev_stop (EV_A_ (W)w);
1626 1618
1627 fd_change (EV_A_ w->fd); 1619 fd_change (EV_A_ w->fd);
1628} 1620}
1629 1621
1636 ((WT)w)->at += mn_now; 1628 ((WT)w)->at += mn_now;
1637 1629
1638 assert (("ev_timer_start called with negative timer repeat value", w->repeat >= 0.)); 1630 assert (("ev_timer_start called with negative timer repeat value", w->repeat >= 0.));
1639 1631
1640 ev_start (EV_A_ (W)w, ++timercnt); 1632 ev_start (EV_A_ (W)w, ++timercnt);
1641 array_needsize (ev_timer *, timers, timermax, timercnt, EMPTY2); 1633 array_needsize (WT, timers, timermax, timercnt, EMPTY2);
1642 timers [timercnt - 1] = w; 1634 timers [timercnt - 1] = (WT)w;
1643 upheap ((WT *)timers, timercnt - 1); 1635 upheap (timers, timercnt - 1);
1644 1636
1645 /*assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w));*/ 1637 /*assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w));*/
1646} 1638}
1647 1639
1648void noinline 1640void noinline
1650{ 1642{
1651 clear_pending (EV_A_ (W)w); 1643 clear_pending (EV_A_ (W)w);
1652 if (expect_false (!ev_is_active (w))) 1644 if (expect_false (!ev_is_active (w)))
1653 return; 1645 return;
1654 1646
1655 assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w)); 1647 assert (("internal timer heap corruption", timers [((W)w)->active - 1] == (WT)w));
1656 1648
1657 { 1649 {
1658 int active = ((W)w)->active; 1650 int active = ((W)w)->active;
1659 1651
1660 if (expect_true (--active < --timercnt)) 1652 if (expect_true (--active < --timercnt))
1661 { 1653 {
1662 timers [active] = timers [timercnt]; 1654 timers [active] = timers [timercnt];
1663 adjustheap ((WT *)timers, timercnt, active); 1655 adjustheap (timers, timercnt, active);
1664 } 1656 }
1665 } 1657 }
1666 1658
1667 ((WT)w)->at -= mn_now; 1659 ((WT)w)->at -= mn_now;
1668 1660
1675 if (ev_is_active (w)) 1667 if (ev_is_active (w))
1676 { 1668 {
1677 if (w->repeat) 1669 if (w->repeat)
1678 { 1670 {
1679 ((WT)w)->at = mn_now + w->repeat; 1671 ((WT)w)->at = mn_now + w->repeat;
1680 adjustheap ((WT *)timers, timercnt, ((W)w)->active - 1); 1672 adjustheap (timers, timercnt, ((W)w)->active - 1);
1681 } 1673 }
1682 else 1674 else
1683 ev_timer_stop (EV_A_ w); 1675 ev_timer_stop (EV_A_ w);
1684 } 1676 }
1685 else if (w->repeat) 1677 else if (w->repeat)
1706 } 1698 }
1707 else 1699 else
1708 ((WT)w)->at = w->offset; 1700 ((WT)w)->at = w->offset;
1709 1701
1710 ev_start (EV_A_ (W)w, ++periodiccnt); 1702 ev_start (EV_A_ (W)w, ++periodiccnt);
1711 array_needsize (ev_periodic *, periodics, periodicmax, periodiccnt, EMPTY2); 1703 array_needsize (WT, periodics, periodicmax, periodiccnt, EMPTY2);
1712 periodics [periodiccnt - 1] = w; 1704 periodics [periodiccnt - 1] = (WT)w;
1713 upheap ((WT *)periodics, periodiccnt - 1); 1705 upheap (periodics, periodiccnt - 1);
1714 1706
1715 /*assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w));*/ 1707 /*assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w));*/
1716} 1708}
1717 1709
1718void noinline 1710void noinline
1720{ 1712{
1721 clear_pending (EV_A_ (W)w); 1713 clear_pending (EV_A_ (W)w);
1722 if (expect_false (!ev_is_active (w))) 1714 if (expect_false (!ev_is_active (w)))
1723 return; 1715 return;
1724 1716
1725 assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w)); 1717 assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == (WT)w));
1726 1718
1727 { 1719 {
1728 int active = ((W)w)->active; 1720 int active = ((W)w)->active;
1729 1721
1730 if (expect_true (--active < --periodiccnt)) 1722 if (expect_true (--active < --periodiccnt))
1731 { 1723 {
1732 periodics [active] = periodics [periodiccnt]; 1724 periodics [active] = periodics [periodiccnt];
1733 adjustheap ((WT *)periodics, periodiccnt, active); 1725 adjustheap (periodics, periodiccnt, active);
1734 } 1726 }
1735 } 1727 }
1736 1728
1737 ev_stop (EV_A_ (W)w); 1729 ev_stop (EV_A_ (W)w);
1738} 1730}
1759 if (expect_false (ev_is_active (w))) 1751 if (expect_false (ev_is_active (w)))
1760 return; 1752 return;
1761 1753
1762 assert (("ev_signal_start called with illegal signal number", w->signum > 0)); 1754 assert (("ev_signal_start called with illegal signal number", w->signum > 0));
1763 1755
1756 {
1757#ifndef _WIN32
1758 sigset_t full, prev;
1759 sigfillset (&full);
1760 sigprocmask (SIG_SETMASK, &full, &prev);
1761#endif
1762
1763 array_needsize (ANSIG, signals, signalmax, w->signum, signals_init);
1764
1765#ifndef _WIN32
1766 sigprocmask (SIG_SETMASK, &prev, 0);
1767#endif
1768 }
1769
1764 ev_start (EV_A_ (W)w, 1); 1770 ev_start (EV_A_ (W)w, 1);
1765 array_needsize (ANSIG, signals, signalmax, w->signum, signals_init);
1766 wlist_add ((WL *)&signals [w->signum - 1].head, (WL)w); 1771 wlist_add (&signals [w->signum - 1].head, (WL)w);
1767 1772
1768 if (!((WL)w)->next) 1773 if (!((WL)w)->next)
1769 { 1774 {
1770#if _WIN32 1775#if _WIN32
1771 signal (w->signum, sighandler); 1776 signal (w->signum, sighandler);
1784{ 1789{
1785 clear_pending (EV_A_ (W)w); 1790 clear_pending (EV_A_ (W)w);
1786 if (expect_false (!ev_is_active (w))) 1791 if (expect_false (!ev_is_active (w)))
1787 return; 1792 return;
1788 1793
1789 wlist_del ((WL *)&signals [w->signum - 1].head, (WL)w); 1794 wlist_del (&signals [w->signum - 1].head, (WL)w);
1790 ev_stop (EV_A_ (W)w); 1795 ev_stop (EV_A_ (W)w);
1791 1796
1792 if (!signals [w->signum - 1].head) 1797 if (!signals [w->signum - 1].head)
1793 signal (w->signum, SIG_DFL); 1798 signal (w->signum, SIG_DFL);
1794} 1799}
1801#endif 1806#endif
1802 if (expect_false (ev_is_active (w))) 1807 if (expect_false (ev_is_active (w)))
1803 return; 1808 return;
1804 1809
1805 ev_start (EV_A_ (W)w, 1); 1810 ev_start (EV_A_ (W)w, 1);
1806 wlist_add ((WL *)&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w); 1811 wlist_add (&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w);
1807} 1812}
1808 1813
1809void 1814void
1810ev_child_stop (EV_P_ ev_child *w) 1815ev_child_stop (EV_P_ ev_child *w)
1811{ 1816{
1812 clear_pending (EV_A_ (W)w); 1817 clear_pending (EV_A_ (W)w);
1813 if (expect_false (!ev_is_active (w))) 1818 if (expect_false (!ev_is_active (w)))
1814 return; 1819 return;
1815 1820
1816 wlist_del ((WL *)&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w); 1821 wlist_del (&childs [w->pid & (EV_PID_HASHSIZE - 1)], (WL)w);
1817 ev_stop (EV_A_ (W)w); 1822 ev_stop (EV_A_ (W)w);
1818} 1823}
1819 1824
1820#if EV_STAT_ENABLE 1825#if EV_STAT_ENABLE
1821 1826

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines