… | |
… | |
897 | postfork = 1; |
897 | postfork = 1; |
898 | } |
898 | } |
899 | |
899 | |
900 | /*****************************************************************************/ |
900 | /*****************************************************************************/ |
901 | |
901 | |
|
|
902 | static int |
|
|
903 | any_pending (EV_P) |
|
|
904 | { |
|
|
905 | int pri; |
|
|
906 | |
|
|
907 | for (pri = NUMPRI; pri--; ) |
|
|
908 | if (pendingcnt [pri]) |
|
|
909 | return 1; |
|
|
910 | |
|
|
911 | return 0; |
|
|
912 | } |
|
|
913 | |
902 | static void |
914 | static void |
903 | call_pending (EV_P) |
915 | call_pending (EV_P) |
904 | { |
916 | { |
905 | int pri; |
917 | int pri; |
906 | |
918 | |
… | |
… | |
1089 | /* update fd-related kernel structures */ |
1101 | /* update fd-related kernel structures */ |
1090 | fd_reify (EV_A); |
1102 | fd_reify (EV_A); |
1091 | |
1103 | |
1092 | /* calculate blocking time */ |
1104 | /* calculate blocking time */ |
1093 | |
1105 | |
1094 | /* we only need this for !monotonic clockor timers, but as we basically |
1106 | /* we only need this for !monotonic clock or timers, but as we basically |
1095 | always have timers, we just calculate it always */ |
1107 | always have timers, we just calculate it always */ |
1096 | #if EV_USE_MONOTONIC |
1108 | #if EV_USE_MONOTONIC |
1097 | if (expect_true (have_monotonic)) |
1109 | if (expect_true (have_monotonic)) |
1098 | time_update_monotonic (EV_A); |
1110 | time_update_monotonic (EV_A); |
1099 | else |
1111 | else |
… | |
… | |
1132 | /* queue pending timers and reschedule them */ |
1144 | /* queue pending timers and reschedule them */ |
1133 | timers_reify (EV_A); /* relative timers called last */ |
1145 | timers_reify (EV_A); /* relative timers called last */ |
1134 | periodics_reify (EV_A); /* absolute timers called first */ |
1146 | periodics_reify (EV_A); /* absolute timers called first */ |
1135 | |
1147 | |
1136 | /* queue idle watchers unless io or timers are pending */ |
1148 | /* queue idle watchers unless io or timers are pending */ |
1137 | if (!pendingcnt) |
1149 | if (idlecnt && !any_pending (EV_A)) |
1138 | queue_events (EV_A_ (W *)idles, idlecnt, EV_IDLE); |
1150 | queue_events (EV_A_ (W *)idles, idlecnt, EV_IDLE); |
1139 | |
1151 | |
1140 | /* queue check watchers, to be executed first */ |
1152 | /* queue check watchers, to be executed first */ |
1141 | if (checkcnt) |
1153 | if (checkcnt) |
1142 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |
1154 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |