diff options
author | Robert Morris <[email protected]> | 2019-07-19 10:20:02 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-07-19 10:20:02 -0400 |
commit | dbd729b32d9b1cfa73d05e59d8bd294823417520 (patch) | |
tree | 37d07d9c54dd178dd1ea9e99eab9634db5ab2e93 /kernel | |
parent | 32168df609efb46d3f1111fda4e4f0ff1d527013 (diff) | |
download | xv6-labs-dbd729b32d9b1cfa73d05e59d8bd294823417520.tar.gz xv6-labs-dbd729b32d9b1cfa73d05e59d8bd294823417520.tar.bz2 xv6-labs-dbd729b32d9b1cfa73d05e59d8bd294823417520.zip |
with per-proc locks, we don't need the intr_on() inside the loop.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/proc.c b/kernel/proc.c index 6ba3fec..b880fd4 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -418,12 +418,12 @@ scheduler(void) { struct proc *p; struct cpu *c = mycpu(); + + // Let devices interrupt when no lock is held. + intr_on(); c->proc = 0; for(;;){ - // Give devices a brief chance to interrupt. - intr_on(); - for(p = proc; p < &proc[NPROC]; p++) { acquire(&p->lock); if(p->state == RUNNABLE) { |