From b9ec5cca6f6e3fd571b2e534d36e2498e488164c Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Thu, 31 Aug 2017 23:17:47 +0200 Subject: kern/timer: improve access synchronization --- kern/timer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kern/timer.h') diff --git a/kern/timer.h b/kern/timer.h index 46616686..a082c538 100644 --- a/kern/timer.h +++ b/kern/timer.h @@ -23,6 +23,7 @@ #include +#include #include /* @@ -47,7 +48,7 @@ typedef void (*timer_fn_t)(struct timer *); static inline uint64_t timer_get_time(const struct timer *timer) { - return timer->ticks; /* TODO atomic */ + return atomic_load(&timer->ticks, ATOMIC_RELAXED); } /* -- cgit v1.2.3