提交 15ce79de 创建 作者: kolya's avatar kolya

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

上级 00ce31c0
......@@ -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();
}
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论