From a5405b43256e19fa21198dba598026a28b5404ca Mon Sep 17 00:00:00 2001 From: Matej Kafka Date: Mon, 22 Nov 2021 05:52:20 +0100 Subject: [PATCH] #70 [bugfix] slice: Clear running_process when process budget is depleted exactly at window end --- src/slice.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slice.cpp b/src/slice.cpp index de5d75b8..2f16e8ab 100644 --- a/src/slice.cpp +++ b/src/slice.cpp @@ -138,10 +138,14 @@ void Slice::stop(time_point current_time) if (remaining == remaining.zero()) { // window ended approximately at the same moment when the process timed out // Slice::stop is called before schedule_next due to higher timer priority - // we stop the running process and load the next one; this may call sc_done_cb - // if this was the last process from the SC partition + // we stop the running process and load the next one (to prepare the partition + // for the next window); this may call sc_done_cb if this was the last process + // from the SC partition + TRACE("Process ran out of budget exactly at the window end"); stop_current_process(); load_next_process(current_time); + // clear running_process set by load_next_process above, as we're not starting it now + running_process = nullptr; return; }