提交 15980f3e 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Fill in addrun.

上级 42ab8787
......@@ -25,10 +25,25 @@ sched(void)
panic("sched");
}
// Mark a process RUNNABLE and add it to the runq
// of its cpu. Caller must hold p->lock so that
// some other core doesn't start running the
// process before the caller has finished setting
// the process up, and to cope with racing callers
// e.g. two wakeups on same process. and to
// allow atomic addrun(); sched();
void
addrun(struct proc *p)
{
panic("addrun");
#if SPINLOCK_DEBUG
if(!holding(&p->lock))
panic("addrun no p->lock");
#endif
if (p->on_runq >= 0)
panic("addrun on runq already");
ns_insert(nsrunq, KI(p->cpuid), p);
p->on_runq = p->cpuid;
}
// A fork child's very first scheduling by scheduler()
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论