… | |
… | |
435 | |
435 | |
436 | |
436 | |
437 | /**/ |
437 | /**/ |
438 | |
438 | |
439 | #if EV_VERIFY >= 3 |
439 | #if EV_VERIFY >= 3 |
440 | # define EV_FREQUENT_CHECK ev_loop_verify (EV_A) |
440 | # define EV_FREQUENT_CHECK ev_verify (EV_A) |
441 | #else |
441 | #else |
442 | # define EV_FREQUENT_CHECK do { } while (0) |
442 | # define EV_FREQUENT_CHECK do { } while (0) |
443 | #endif |
443 | #endif |
444 | |
444 | |
445 | /* |
445 | /* |
… | |
… | |
1531 | return backend; |
1531 | return backend; |
1532 | } |
1532 | } |
1533 | |
1533 | |
1534 | #if EV_FEATURE_API |
1534 | #if EV_FEATURE_API |
1535 | unsigned int |
1535 | unsigned int |
1536 | ev_loop_count (EV_P) |
1536 | ev_iteration (EV_P) |
1537 | { |
1537 | { |
1538 | return loop_count; |
1538 | return loop_count; |
1539 | } |
1539 | } |
1540 | |
1540 | |
1541 | unsigned int |
1541 | unsigned int |
1542 | ev_loop_depth (EV_P) |
1542 | ev_depth (EV_P) |
1543 | { |
1543 | { |
1544 | return loop_depth; |
1544 | return loop_depth; |
1545 | } |
1545 | } |
1546 | |
1546 | |
1547 | void |
1547 | void |
… | |
… | |
1868 | } |
1868 | } |
1869 | #endif |
1869 | #endif |
1870 | |
1870 | |
1871 | #if EV_FEATURE_API |
1871 | #if EV_FEATURE_API |
1872 | void |
1872 | void |
1873 | ev_loop_verify (EV_P) |
1873 | ev_verify (EV_P) |
1874 | { |
1874 | { |
1875 | #if EV_VERIFY |
1875 | #if EV_VERIFY |
1876 | int i; |
1876 | int i; |
1877 | WL w; |
1877 | WL w; |
1878 | |
1878 | |
… | |
… | |
2096 | EV_FREQUENT_CHECK; |
2096 | EV_FREQUENT_CHECK; |
2097 | feed_reverse (EV_A_ (W)w); |
2097 | feed_reverse (EV_A_ (W)w); |
2098 | } |
2098 | } |
2099 | while (timercnt && ANHE_at (timers [HEAP0]) < mn_now); |
2099 | while (timercnt && ANHE_at (timers [HEAP0]) < mn_now); |
2100 | |
2100 | |
2101 | feed_reverse_done (EV_A_ EV_TIMEOUT); |
2101 | feed_reverse_done (EV_A_ EV_TIMER); |
2102 | } |
2102 | } |
2103 | } |
2103 | } |
2104 | |
2104 | |
2105 | #if EV_PERIODIC_ENABLE |
2105 | #if EV_PERIODIC_ENABLE |
2106 | /* make periodics pending */ |
2106 | /* make periodics pending */ |
… | |
… | |
2280 | EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */ |
2280 | EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */ |
2281 | |
2281 | |
2282 | do |
2282 | do |
2283 | { |
2283 | { |
2284 | #if EV_VERIFY >= 2 |
2284 | #if EV_VERIFY >= 2 |
2285 | ev_loop_verify (EV_A); |
2285 | ev_verify (EV_A); |
2286 | #endif |
2286 | #endif |
2287 | |
2287 | |
2288 | #ifndef _WIN32 |
2288 | #ifndef _WIN32 |
2289 | if (expect_false (curpid)) /* penalise the forking check even more */ |
2289 | if (expect_false (curpid)) /* penalise the forking check even more */ |
2290 | if (expect_false (getpid () != curpid)) |
2290 | if (expect_false (getpid () != curpid)) |
… | |
… | |
3636 | { |
3636 | { |
3637 | struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once)); |
3637 | struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once)); |
3638 | |
3638 | |
3639 | if (expect_false (!once)) |
3639 | if (expect_false (!once)) |
3640 | { |
3640 | { |
3641 | cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT, arg); |
3641 | cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMER, arg); |
3642 | return; |
3642 | return; |
3643 | } |
3643 | } |
3644 | |
3644 | |
3645 | once->cb = cb; |
3645 | once->cb = cb; |
3646 | once->arg = arg; |
3646 | once->arg = arg; |