From: kolya Date: Wed, 15 Oct 2008 04:57:02 +0000 (+0000) Subject: check cp->killed before returning to user from a timer interrupt X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=15ce79de141f66c7dd2f2948ce4584a2d31f7040;p=cs3210-lab0.git check cp->killed before returning to user from a timer interrupt --- diff --git a/trap.c b/trap.c index 533f3f0..fd00071 100644 --- a/trap.c +++ b/trap.c @@ -91,4 +91,8 @@ trap(struct trapframe *tf) // If interrupts were on while locks held, would need to check nlock. if(cp && cp->state == RUNNING && tf->trapno == IRQ_OFFSET+IRQ_TIMER) yield(); + + // Check if the process has been killed since we yielded + if(cp && cp->killed && (tf->cs&3) == DPL_USER) + exit(); }