--- libev/ev.c 2018/07/31 04:45:58 1.483 +++ libev/ev.c 2018/07/31 05:40:58 1.484 @@ -3306,10 +3306,11 @@ { pendingpri = NUMPRI; - while (pendingpri) /* pendingpri possibly gets modified in the inner loop */ + do { --pendingpri; + /* pendingpri possibly gets modified in the inner loop */ while (pendingcnt [pendingpri]) { ANPENDING *p = pendings [pendingpri] + --pendingcnt [pendingpri]; @@ -3319,6 +3320,7 @@ EV_FREQUENT_CHECK; } } + while (pendingpri); } #if EV_IDLE_ENABLE