--- libev/ev.c 2012/05/31 17:53:26 1.443 +++ libev/ev.c 2012/06/01 22:01:13 1.444 @@ -3180,6 +3180,10 @@ if (loop_done == EVBREAK_ONE) loop_done = EVBREAK_CANCEL; + /* pendingpri is normally -1 here, which is not a good */ + /* value when returning to an ev_invoke_pending */ + pendingpri = NUMPRI - 1; + #if EV_FEATURE_API --loop_depth; #endif