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

unsafe to continue SLIST_FOREACH in scheduler after letting go of runq->lock

上级 971c3376
...@@ -425,11 +425,14 @@ scheduler(void) ...@@ -425,11 +425,14 @@ scheduler(void)
proc = 0; proc = 0;
release(&p->lock); release(&p->lock);
acquire(&runq->lock); // Cannot loop: process may have been stolen, run_next is another runq.
break;
} }
release(&runq->lock);
steal(); if(p==0) {
release(&runq->lock);
steal();
}
} }
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论