diff options
author | julian <julian@FreeBSD.org> | 2004-07-18 23:36:13 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-07-18 23:36:13 +0000 |
commit | a488bebcd21f1e39697ac09fdac970a06d6fb621 (patch) | |
tree | 548243b8828b679ca121764ef843b623c31cf5b9 /sys/kern/kern_thr.c | |
parent | d538dc62fd30a8ac9beb2f57ffc4321e42569aab (diff) | |
download | FreeBSD-src-a488bebcd21f1e39697ac09fdac970a06d6fb621.zip FreeBSD-src-a488bebcd21f1e39697ac09fdac970a06d6fb621.tar.gz |
When calling scheduler entrypoints for creating new threads and processes,
specify "us" as the thread not the process/ksegrp/kse.
You can always find the others from the thread but the converse is not true.
Theorotically this would lead to runtime being allocated to the wrong
entity in some cases though it is not clear how often this actually happenned.
(would only affect threaded processes and would probably be pretty benign,
but it WAS a bug..)
Reviewed by: peter
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 856e2dc..0303fa9 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -87,7 +87,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); + sched_exit_kse(TAILQ_NEXT(ke, ke_kglist), td); /* * If we were stopped while waiting for all threads to exit and this @@ -177,7 +177,7 @@ 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_kse(td, ke0); sched_fork_thread(td, td0); TD_SET_CAN_RUN(td0); |