summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-08-09 21:57:30 +0000
committerjulian <julian@FreeBSD.org>2004-08-09 21:57:30 +0000
commit00a6534a31f081dd596c716bfd9d3085818ff111 (patch)
tree3146c333d13d2a5fff2f443e28ec63b7a44132fe /sys/kern/kern_kse.c
parentce67d2b645cbeb6603a146ba0c2246eda35dd190 (diff)
downloadFreeBSD-src-00a6534a31f081dd596c716bfd9d3085818ff111.zip
FreeBSD-src-00a6534a31f081dd596c716bfd9d3085818ff111.tar.gz
Slight changes to comments and some whitespace changes.
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index c85c165..26e5178 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -1016,7 +1016,7 @@ thread_alloc_spare(struct thread *td)
spare = thread_alloc();
td->td_standin = spare;
bzero(&spare->td_startzero,
- (unsigned)RANGEOF(struct thread, td_startzero, td_endzero));
+ (unsigned) RANGEOF(struct thread, td_startzero, td_endzero));
spare->td_proc = td->td_proc;
spare->td_ucred = crhold(td->td_ucred);
}
@@ -1046,6 +1046,10 @@ thread_schedule_upcall(struct thread *td, struct kse_upcall *ku)
}
CTR3(KTR_PROC, "thread_schedule_upcall: thread %p (pid %d, %s)",
td2, td->td_proc->p_pid, td->td_proc->p_comm);
+ /*
+ * Bzero already done in thread_alloc_spare() because we can't
+ * do the crhold here because we are in schedlock already.
+ */
bcopy(&td->td_startcopy, &td2->td_startcopy,
(unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy));
thread_link(td2, ku->ku_ksegrp);
@@ -1122,7 +1126,10 @@ thread_switchout(struct thread *td)
/*
* Release ownership of upcall, and schedule an upcall
* thread, this new upcall thread becomes the owner of
- * the upcall structure.
+ * the upcall structure. It will be ahead of us in the
+ * run queue, so as we are stopping, it should either
+ * start up immediatly, or at least before us if
+ * we release our slot.
*/
ku = td->td_upcall;
ku->ku_owner = NULL;
@@ -1349,7 +1356,7 @@ thread_userret(struct thread *td, struct trapframe *frame)
if (p->p_flag & P_TRACED)
ptrace_clear_single_step(td);
error = suword32(&ku->ku_mailbox->km_lwp,
- td->td_tid);
+ td->td_tid);
if (error)
goto out;
error = suword(&ku->ku_mailbox->km_curthread, 0);
OpenPOWER on IntegriCloud