From df71e02ef630169bfcb04a928ef97d987a3fee03 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 4 Oct 2017 13:10:11 +0200 Subject: [PATCH] alarm: fix bug in _setup_alarm We did not set the correct now_period previously but it wasn't conspicuous because the bug triggered not before a full period had passed which on most platforms is a pretty long time. Ref #2490 --- repos/os/src/lib/alarm/alarm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/src/lib/alarm/alarm.cc b/repos/os/src/lib/alarm/alarm.cc index a38e495206..cdd331c2ab 100644 --- a/repos/os/src/lib/alarm/alarm.cc +++ b/repos/os/src/lib/alarm/alarm.cc @@ -198,7 +198,7 @@ void Alarm_scheduler::_setup_alarm(Alarm &alarm, Alarm::Time period, Alarm::Time if (alarm._active) _unsynchronized_dequeue(&alarm); - alarm._assign(period, deadline, _now > deadline, this); + alarm._assign(period, deadline, _now > deadline ? !_now_period : _now_period, this); _unsynchronized_enqueue(&alarm); }