… | |
… | |
1370 | void |
1370 | void |
1371 | ev_loop_fork (EV_P) |
1371 | ev_loop_fork (EV_P) |
1372 | { |
1372 | { |
1373 | postfork = 1; /* must be in line with ev_default_fork */ |
1373 | postfork = 1; /* must be in line with ev_default_fork */ |
1374 | } |
1374 | } |
1375 | |
|
|
1376 | #endif |
1375 | #endif |
1377 | |
1376 | |
1378 | #if EV_MULTIPLICITY |
1377 | #if EV_MULTIPLICITY |
1379 | struct ev_loop * |
1378 | struct ev_loop * |
1380 | ev_default_loop_init (unsigned int flags) |
1379 | ev_default_loop_init (unsigned int flags) |
… | |
… | |
1460 | p->w->pending = 0; |
1459 | p->w->pending = 0; |
1461 | EV_CB_INVOKE (p->w, p->events); |
1460 | EV_CB_INVOKE (p->w, p->events); |
1462 | } |
1461 | } |
1463 | } |
1462 | } |
1464 | } |
1463 | } |
|
|
1464 | |
|
|
1465 | #if EV_IDLE_ENABLE |
|
|
1466 | void inline_size |
|
|
1467 | idle_reify (EV_P) |
|
|
1468 | { |
|
|
1469 | if (expect_false (idleall)) |
|
|
1470 | { |
|
|
1471 | int pri; |
|
|
1472 | |
|
|
1473 | for (pri = NUMPRI; pri--; ) |
|
|
1474 | { |
|
|
1475 | if (pendingcnt [pri]) |
|
|
1476 | break; |
|
|
1477 | |
|
|
1478 | if (idlecnt [pri]) |
|
|
1479 | { |
|
|
1480 | queue_events (EV_A_ (W *)idles [pri], idlecnt [pri], EV_IDLE); |
|
|
1481 | break; |
|
|
1482 | } |
|
|
1483 | } |
|
|
1484 | } |
|
|
1485 | } |
|
|
1486 | #endif |
1465 | |
1487 | |
1466 | void inline_size |
1488 | void inline_size |
1467 | timers_reify (EV_P) |
1489 | timers_reify (EV_P) |
1468 | { |
1490 | { |
1469 | while (timercnt && ev_at (timers [1]) <= mn_now) |
1491 | while (timercnt && ev_at (timers [1]) <= mn_now) |
… | |
… | |
1541 | for (i = periodiccnt >> 1; i--; ) |
1563 | for (i = periodiccnt >> 1; i--; ) |
1542 | downheap (periodics, periodiccnt, i); |
1564 | downheap (periodics, periodiccnt, i); |
1543 | } |
1565 | } |
1544 | #endif |
1566 | #endif |
1545 | |
1567 | |
1546 | #if EV_IDLE_ENABLE |
|
|
1547 | void inline_size |
|
|
1548 | idle_reify (EV_P) |
|
|
1549 | { |
|
|
1550 | if (expect_false (idleall)) |
|
|
1551 | { |
|
|
1552 | int pri; |
|
|
1553 | |
|
|
1554 | for (pri = NUMPRI; pri--; ) |
|
|
1555 | { |
|
|
1556 | if (pendingcnt [pri]) |
|
|
1557 | break; |
|
|
1558 | |
|
|
1559 | if (idlecnt [pri]) |
|
|
1560 | { |
|
|
1561 | queue_events (EV_A_ (W *)idles [pri], idlecnt [pri], EV_IDLE); |
|
|
1562 | break; |
|
|
1563 | } |
|
|
1564 | } |
|
|
1565 | } |
|
|
1566 | } |
|
|
1567 | #endif |
|
|
1568 | |
|
|
1569 | void inline_speed |
1568 | void inline_speed |
1570 | time_update (EV_P_ ev_tstamp max_block) |
1569 | time_update (EV_P_ ev_tstamp max_block) |
1571 | { |
1570 | { |
1572 | int i; |
1571 | int i; |
1573 | |
1572 | |
… | |
… | |
1599 | */ |
1598 | */ |
1600 | for (i = 4; --i; ) |
1599 | for (i = 4; --i; ) |
1601 | { |
1600 | { |
1602 | rtmn_diff = ev_rt_now - mn_now; |
1601 | rtmn_diff = ev_rt_now - mn_now; |
1603 | |
1602 | |
1604 | if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) |
1603 | if (expect_true (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP)) |
1605 | return; /* all is well */ |
1604 | return; /* all is well */ |
1606 | |
1605 | |
1607 | ev_rt_now = ev_time (); |
1606 | ev_rt_now = ev_time (); |
1608 | mn_now = get_clock (); |
1607 | mn_now = get_clock (); |
1609 | now_floor = mn_now; |
1608 | now_floor = mn_now; |