summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-04-11 19:24:37 +0000
committerjeff <jeff@FreeBSD.org>2003-04-11 19:24:37 +0000
commit97ecb163cb8387050472c30318634ad60b5c6219 (patch)
treeb3293d53ae3ffb83400420d73f7e2ee8def5c129 /sys/kern
parentb5bf29d7350302d33c4b237babd2e631bc372303 (diff)
downloadFreeBSD-src-97ecb163cb8387050472c30318634ad60b5c6219.zip
FreeBSD-src-97ecb163cb8387050472c30318634ad60b5c6219.tar.gz
- Call sched_exit_{kse,thread} and sched_fork{kse,thread} so that thr works
with ULE. This was not strictly required by sched_4bsd.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_thr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 6e277da..c2a2103 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -33,6 +33,7 @@
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
+#include <sys/sched.h>
#include <sys/sysent.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
@@ -89,6 +90,7 @@ thr_exit1(void)
ke->ke_state = KES_UNQUEUED;
ke->ke_thread = NULL;
kse_unlink(ke);
+ sched_exit_kse(TAILQ_NEXT(ke, ke_kglist), ke);
/*
* If we were stopped while waiting for all threads to exit and this
@@ -106,6 +108,7 @@ thr_exit1(void)
#endif
td->td_ksegrp = NULL;
td->td_last_kse = NULL;
+ sched_exit_thread(TAILQ_NEXT(td, td_kglist), td);
thread_stash(td);
#if defined(__i386__) || defined(__sparc64__)
@@ -178,6 +181,9 @@ thr_create(struct thread *td, struct thr_create_args *uap)
td0->td_kse = ke0;
ke0->ke_thread = td0;
+ sched_fork_kse(td->td_kse, ke0);
+ sched_fork_thread(td, td0);
+
TD_SET_CAN_RUN(td0);
if ((uap->flags & THR_SUSPENDED) == 0)
setrunqueue(td0);
OpenPOWER on IntegriCloud