diff --git a/proc.c b/proc.c index 37fd768fe8..e48f1ca779 100644 --- a/proc.c +++ b/proc.c @@ -207,6 +207,11 @@ sched(void) { struct proc *p = curproc[cpu()]; + if(!holding(&proc_table_lock)) + panic("sched"); + if(cpus[cpu()].nlock != 1) + panic("sched locks"); + if(setjmp(&p->jmpbuf) == 0) longjmp(&cpus[cpu()].jmpbuf); }