提交 394c7889 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

avoid deadlock

上级 d453331b
......@@ -349,7 +349,6 @@ steal(void)
{
int c;
struct proc *p;
int r = 0;
for (c = 0; c < NCPU; c++) {
if (c == cpunum())
......@@ -359,15 +358,12 @@ steal(void)
if (p->state == RUNNABLE) {
//cprintf("%d: steal %d from %d\n", cpunum(), p->pid, c);
delrun1(&runqs[c], p);
release(&runqs[c].lock);
addrun(p);
r = 1;
break;
return;
}
}
release(&runqs[c].lock);
if (r) {
return;
}
}
}
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论