diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-10-11 22:01:45 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-10-12 11:59:27 -0400 |
commit | 744c6d114e3681a2e8cfcd4475424a7d19774d52 (patch) | |
tree | e6461641b82cf0a59fe99e171a69343fcda1b78b /src/linux | |
parent | 3b9b4e4d6f68216470bcb86070033a26a3562e23 (diff) | |
download | kutter-744c6d114e3681a2e8cfcd4475424a7d19774d52.tar.gz kutter-744c6d114e3681a2e8cfcd4475424a7d19774d52.tar.xz kutter-744c6d114e3681a2e8cfcd4475424a7d19774d52.zip |
sched: Don't shutdown on a "timer in the past" if already shutdown
A shutdown will not help if the mcu is already in a shutdown state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/linux')
-rw-r--r-- | src/linux/timer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/linux/timer.c b/src/linux/timer.c index 016f3da3..d53dd7da 100644 --- a/src/linux/timer.c +++ b/src/linux/timer.c @@ -166,9 +166,8 @@ timer_dispatch(void) if (unlikely(timespec_is_before(tru, now))) { // Check if there are too many repeat timers - if (unlikely(timespec_is_before(timespec_add(nt, 100000000), now)) - && !sched_is_shutdown()) - shutdown("Rescheduled timer in the past"); + if (unlikely(timespec_is_before(timespec_add(nt, 100000000), now))) + try_shutdown("Rescheduled timer in the past"); if (sched_tasks_busy()) { timer_repeat_until = timespec_add(now, TIMER_REPEAT_NS); next_wake_time = timespec_add(now, TIMER_DEFER_REPEAT_NS); |