with per-proc locks, we don't need the intr_on() inside the loop.
This commit is contained in:
		
							parent
							
								
									32168df609
								
							
						
					
					
						commit
						dbd729b32d
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -418,12 +418,12 @@ scheduler(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  struct proc *p;
 | 
					  struct proc *p;
 | 
				
			||||||
  struct cpu *c = mycpu();
 | 
					  struct cpu *c = mycpu();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Let devices interrupt when no lock is held.
 | 
				
			||||||
 | 
					  intr_on();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  c->proc = 0;
 | 
					  c->proc = 0;
 | 
				
			||||||
  for(;;){
 | 
					  for(;;){
 | 
				
			||||||
    // Give devices a brief chance to 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