|
@@ -180,14 +180,20 @@ static void timer_expired ( struct retry_timer *timer ) {
|
180
|
180
|
*/
|
181
|
181
|
static void retry_step ( struct process *process __unused ) {
|
182
|
182
|
struct retry_timer *timer;
|
183
|
|
- struct retry_timer *tmp;
|
184
|
183
|
unsigned long now = currticks();
|
185
|
184
|
unsigned long used;
|
186
|
185
|
|
187
|
|
- list_for_each_entry_safe ( timer, tmp, &timers, list ) {
|
|
186
|
+ /* Process at most one timer expiry. We cannot process
|
|
187
|
+ * multiple expiries in one pass, because one timer expiring
|
|
188
|
+ * may end up triggering another timer's deletion from the
|
|
189
|
+ * list.
|
|
190
|
+ */
|
|
191
|
+ list_for_each_entry ( timer, &timers, list ) {
|
188
|
192
|
used = ( now - timer->start );
|
189
|
|
- if ( used >= timer->timeout )
|
|
193
|
+ if ( used >= timer->timeout ) {
|
190
|
194
|
timer_expired ( timer );
|
|
195
|
+ break;
|
|
196
|
+ }
|
191
|
197
|
}
|
192
|
198
|
}
|
193
|
199
|
|