… | |
… | |
1542 | static int loop_done; |
1542 | static int loop_done; |
1543 | |
1543 | |
1544 | void |
1544 | void |
1545 | ev_loop (EV_P_ int flags) |
1545 | ev_loop (EV_P_ int flags) |
1546 | { |
1546 | { |
1547 | loop_done = flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK) |
1547 | loop_done = EVUNLOOP_CANCEL; |
1548 | ? EVUNLOOP_ONE |
|
|
1549 | : EVUNLOOP_CANCEL; |
|
|
1550 | |
1548 | |
1551 | call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */ |
1549 | call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */ |
1552 | |
1550 | |
1553 | do |
1551 | do |
1554 | { |
1552 | { |
… | |
… | |
1650 | /* queue check watchers, to be executed first */ |
1648 | /* queue check watchers, to be executed first */ |
1651 | if (expect_false (checkcnt)) |
1649 | if (expect_false (checkcnt)) |
1652 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |
1650 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |
1653 | |
1651 | |
1654 | call_pending (EV_A); |
1652 | call_pending (EV_A); |
1655 | |
|
|
1656 | } |
1653 | } |
1657 | while (expect_true (activecnt && !loop_done)); |
1654 | while (expect_true ( |
|
|
1655 | activecnt |
|
|
1656 | && !loop_done |
|
|
1657 | && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK)) |
|
|
1658 | )); |
1658 | |
1659 | |
1659 | if (loop_done == EVUNLOOP_ONE) |
1660 | if (loop_done == EVUNLOOP_ONE) |
1660 | loop_done = EVUNLOOP_CANCEL; |
1661 | loop_done = EVUNLOOP_CANCEL; |
1661 | } |
1662 | } |
1662 | |
1663 | |