--- libev/ev.c 2007/12/01 19:48:36 1.159 +++ libev/ev.c 2007/12/01 22:57:20 1.160 @@ -1344,7 +1344,7 @@ call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */ - for (;;) + while (expect_false (!activecnt)) { #ifndef _WIN32 if (expect_false (curpid)) /* penalise the forking check even more */ @@ -1386,7 +1386,7 @@ { ev_tstamp block; - if (flags & EVLOOP_NONBLOCK || idlecnt) + if (expect_false (flags & EVLOOP_NONBLOCK || idlecnt || !activecnt)) block = 0.; /* do not block at all */ else {