Skip to content

Commit

Permalink
no need to check state == RUNNING in timer interrupt because
Browse files Browse the repository at this point in the history
interrupts are always off (i.e. a lock is held) any time the
current process is not in RUNNING state.
  • Loading branch information
Robert Morris committed Oct 14, 2023
1 parent 0c32c04 commit 2b55250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b55250

Please sign in to comment.