summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-09-16 05:37:40 +0000
committerjulian <julian@FreeBSD.org>2004-09-16 05:37:40 +0000
commitb4933d440583a497f0869a669f11ffd16e3b1f0e (patch)
treea6986723fc150925ab067d58a808e4e2b70e366f /sys
parentab1b0390a392629c779953217aa0d4f8139e4fe2 (diff)
downloadFreeBSD-src-b4933d440583a497f0869a669f11ffd16e3b1f0e.zip
FreeBSD-src-b4933d440583a497f0869a669f11ffd16e3b1f0e.tar.gz
e specific code to revert a partial add ot teh run queue, not
remrunqueue() which can't handle a partially added thread. MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_switch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index 7c84c64..7d3a44f 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -536,8 +536,16 @@ maybe_preempt(struct thread *td)
/*
* If this is a threaded process we actually ARE on the
* ksegrp run queue so take it off that first.
+ * Also undo any damage done to the last_assigned pointer.
+ * XXX Fix setrunqueue so this isn't needed
*/
- remrunqueue(td); /* maybe use a simpler version */
+ struct ksegrp *kg;
+
+ kg = td->td_ksegrp;
+ if (kg->kg_last_assigned == td)
+ kg->kg_last_assigned =
+ TAILQ_PREV(td, threadqueue, td_runq);
+ TAILQ_REMOVE(&kg->kg_runq, td, td_runq);
}
TD_SET_RUNNING(td);
OpenPOWER on IntegriCloud