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:
Robert Morris 2023-10-14 06:24:14 -04:00
parent 0c32c04b29
commit 2b552503c0

View file

@ -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,