check cp->killed before returning to user from a timer interrupt

This commit is contained in:
kolya 2008-10-15 04:57:02 +00:00
parent 00ce31c09c
commit 15ce79de14

4
trap.c
View file

@ -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();
}