no need to check state == RUNNING in timer interrupt because
interrupts are always off (i.e. a lock is held) any time the current process is not in RUNNING state.
This commit is contained in:
parent
0c32c04b29
commit
2b552503c0
1 changed files with 1 additions and 1 deletions
|
@ -151,7 +151,7 @@ kerneltrap()
|
|||
}
|
||||
|
||||
// give up the CPU if this is a timer interrupt.
|
||||
if(which_dev == 2 && myproc() != 0 && myproc()->state == RUNNING)
|
||||
if(which_dev == 2 && myproc() != 0)
|
||||
yield();
|
||||
|
||||
// the yield() may have caused some traps to occur,
|
||||
|
|
Loading…
Add table
Reference in a new issue