This commit is contained in:
Robert Morris 2019-07-20 10:17:26 -04:00
parent 2418ac380c
commit 3333665ab6

View file

@ -49,7 +49,7 @@ mycpu(void) {
return c; return c;
} }
// Return the current struct proc *. // Return the current struct proc *, or zero if none.
struct proc* struct proc*
myproc(void) { myproc(void) {
push_off(); push_off();
@ -421,7 +421,7 @@ scheduler(void)
c->proc = 0; c->proc = 0;
for(;;){ for(;;){
// Let devices interrupt when no lock is held. // Avoid deadlock by ensuring that devices can interrupt.
intr_on(); intr_on();
for(p = proc; p < &proc[NPROC]; p++) { for(p = proc; p < &proc[NPROC]; p++) {