diff options
author | Alexander Motin <mav@FreeBSD.org> | 2014-08-23 17:31:56 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2014-08-23 17:31:56 +0000 |
commit | 2e7d7bb294759eb7ed070772a8327c3139adaee6 (patch) | |
tree | bd6c609b31947633a1fbdc87d6fc05a640029a51 /sys/kern/sched_4bsd.c | |
parent | ce470233d428ba277a9fdaaccf2b103a24025bcf (diff) | |
download | src-2e7d7bb294759eb7ed070772a8327c3139adaee6.tar.gz src-2e7d7bb294759eb7ed070772a8327c3139adaee6.zip |
Restore pre-r239157 handling of sched_yield(), when thread time slice was
aborted, allowing other threads to run. Without this change thread is just
rescheduled again, that was illustrated by provided test tool.
PR: 192926
Submitted by: eric@vangyzen.net
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=270423
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 2309ecb1d0bc..3e39d558dcda 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -982,7 +982,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); + preempted = !((td->td_flags & TDF_SLICEEND) || + (flags & SWT_RELINQUISH)); td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); td->td_owepreempt = 0; td->td_oncpu = NOCPU; |