From a658189efe12202e3cdad5c1c17e2996d120add5 Mon Sep 17 00:00:00 2001 From: Talha Qamar Date: Wed, 27 Nov 2024 02:29:43 +0500 Subject: [PATCH] Cleaning of interrupt lookup after process end --- kernel/src/task.rs | 8 ++++++++ sysdata/programs/timer_test/src/main.hb | 10 ++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/kernel/src/task.rs b/kernel/src/task.rs index 9aa67f8..7cf5c10 100644 --- a/kernel/src/task.rs +++ b/kernel/src/task.rs @@ -100,6 +100,14 @@ impl Executor { if let Poll::Ready(()) = task.poll(&mut cx) { self.tasks.remove(id); + self.interrupt_lookup.map(move |pid|{ + if let Some(pid) = pid{ + if pid == id { + return None; + } + } + return pid; + }); } } } diff --git a/sysdata/programs/timer_test/src/main.hb b/sysdata/programs/timer_test/src/main.hb index d359f3c..b2142ea 100644 --- a/sysdata/programs/timer_test/src/main.hb +++ b/sysdata/programs/timer_test/src/main.hb @@ -2,9 +2,7 @@ sleep := @use("../../../libraries/stn/src/sleep.hb") log := @use("../../../libraries/stn/src/log.hb") main := fn(): int { - loop { - log.info("BEFORE\0") - sleep.sleep_until_interrupt(32) - log.info("AFTER\0") - } -} + log.info("BEFORE\0") + sleep.sleep_until_interrupt(32) + log.info("AFTER\0") +} \ No newline at end of file