aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/timer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/timer.c b/core/timer.c
index 4b5925f..b10a564 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -223,7 +223,6 @@ static void __check_timers(uint64_t now)
void check_timers(bool from_interrupt)
{
- struct timer *t;
uint64_t now = mftb();
/* This is the polling variant, the SLW interrupt path, when it
@@ -231,9 +230,11 @@ void check_timers(bool from_interrupt)
* the pollers
*/
- /* Lockless "peek", a bit racy but shouldn't be a problem */
- t = list_top(&timer_list, struct timer, link);
- if (list_empty_nocheck(&timer_poll_list) && (!t || t->target > now))
+ /* Lockless "peek", a bit racy but shouldn't be a problem as
+ * we are only looking at whether the list is empty
+ */
+ if (list_empty_nocheck(&timer_poll_list) &&
+ list_empty_nocheck(&timer_list))
return;
/* Take lock and try again */