aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-11-06 00:19:48 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-11-06 00:19:48 -0400
commit9ecddd1ba4fe6d481f01fa2b1d9175b927907156 (patch)
tree9edf17bbda39ad6064e6b615c734310f94ef5211
parentdccd5554091561ec3099de32505530b4295b67d9 (diff)
downloadkutter-9ecddd1ba4fe6d481f01fa2b1d9175b927907156.tar.gz
kutter-9ecddd1ba4fe6d481f01fa2b1d9175b927907156.tar.xz
kutter-9ecddd1ba4fe6d481f01fa2b1d9175b927907156.zip
sched: Fix scheduling bug in repeat scheduler check
Commit 7d95a004 introduced a defect - if the cached timer pointed to by last_insert did not reschedule itself then the cache would not be in a valid state and other active timers may not get properly rescheduled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/sched.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sched.c b/src/sched.c
index 51dc3889..c5d1d6fd 100644
--- a/src/sched.c
+++ b/src/sched.c
@@ -161,6 +161,8 @@ sched_timer_dispatch(void)
// Update timer_list (rescheduling current timer if necessary)
unsigned int next_waketime = updated_waketime;
if (unlikely(res == SF_DONE)) {
+ if (SchedStatus.last_insert == t)
+ SchedStatus.last_insert = t->next;
next_waketime = t->next->waketime;
SchedStatus.timer_list = t->next;
} else if (!timer_is_before(updated_waketime, t->next->waketime)) {