mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
Fix bug #48568 (timeouts does not support late firing properly) by assuming sys_check_timeouts() jitter can' be too bad
This commit is contained in:
parent
1bb2539f74
commit
a326b057b3
@ -246,6 +246,12 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
||||
if (t->next == NULL || t->next->time > timeout->time) {
|
||||
if (t->next != NULL) {
|
||||
t->next->time -= timeout->time;
|
||||
} else if (timeout->time > msecs) {
|
||||
/* If this is the case, 'timeouts_last_time' and 'now' differs too much.
|
||||
This can be due to sys_check_timeouts() not being called at the right
|
||||
times, but also when stopping in a breakpoint. Anyway, let's assume
|
||||
this is not wanted, so add the first timer's time instead of 'diff' */
|
||||
timeout->time = msecs + next_timeout->time;
|
||||
}
|
||||
timeout->next = t->next;
|
||||
t->next = timeout;
|
||||
|
Loading…
Reference in New Issue
Block a user