scheduler()'s intr_on() is in the wrong place, reflecting
the locking scheme from long ago.
This commit is contained in:
parent
348cf7fee4
commit
f376ad7f1f
1 changed files with 4 additions and 3 deletions
|
@ -446,12 +446,13 @@ scheduler(void)
|
||||||
{
|
{
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
struct cpu *c = mycpu();
|
struct cpu *c = mycpu();
|
||||||
|
|
||||||
|
// Interrupts are disabled at first, but they must be
|
||||||
|
// enabled in order for the shell to get input.
|
||||||
|
intr_on();
|
||||||
|
|
||||||
c->proc = 0;
|
c->proc = 0;
|
||||||
for(;;){
|
for(;;){
|
||||||
// Avoid deadlock by ensuring that devices can interrupt.
|
|
||||||
intr_on();
|
|
||||||
|
|
||||||
for(p = proc; p < &proc[NPROC]; p++) {
|
for(p = proc; p < &proc[NPROC]; p++) {
|
||||||
acquire(&p->lock);
|
acquire(&p->lock);
|
||||||
if(p->state == RUNNABLE) {
|
if(p->state == RUNNABLE) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue