summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_4bsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r--sys/kern/sched_4bsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index db23e1d..7309ae3 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -963,8 +963,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
sched_load_rem();
td->td_lastcpu = td->td_oncpu;
- preempted = !((td->td_flags & TDF_SLICEEND) ||
- (flags & SWT_RELINQUISH));
+ preempted = (td->td_flags & TDF_SLICEEND) == 0 &&
+ (flags & SW_PREEMPT) != 0;
td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND);
td->td_owepreempt = 0;
td->td_oncpu = NOCPU;
OpenPOWER on IntegriCloud