diff options
author | kib <kib@FreeBSD.org> | 2014-09-03 08:35:42 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-09-03 08:35:42 +0000 |
commit | 7e3c6a1f22081211cc2cdbad39e6e2b5de5d751d (patch) | |
tree | 9abf8e67c0d88e814d2c3ca26b42644be0e4b566 | |
parent | 2e01608625bd63637f497eeabe62349603566c23 (diff) | |
download | FreeBSD-src-7e3c6a1f22081211cc2cdbad39e6e2b5de5d751d.zip FreeBSD-src-7e3c6a1f22081211cc2cdbad39e6e2b5de5d751d.tar.gz |
Retire thread_unthread(), it has only one caller. Update comment in
the block of code before the previous call to thread_unthread().
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
-rw-r--r-- | sys/kern/kern_thread.c | 23 | ||||
-rw-r--r-- | sys/sys/proc.h | 1 |
2 files changed, 5 insertions, 19 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index b132510..71f9b7e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -549,18 +549,6 @@ thread_link(struct thread *td, struct proc *p) } /* - * Convert a process with one thread to an unthreaded process. - */ -void -thread_unthread(struct thread *td) -{ - struct proc *p = td->td_proc; - - KASSERT((p->p_numthreads == 1), ("Unthreading with >1 threads")); - p->p_flag &= ~P_HADTHREADS; -} - -/* * Called from: * thread_exit() */ @@ -712,14 +700,13 @@ stopme: } if (mode == SINGLE_EXIT) { /* - * We have gotten rid of all the other threads and we - * are about to either exit or exec. In either case, - * we try our utmost to revert to being a non-threaded - * process. + * Convert the process to an unthreaded process. The + * SINGLE_EXIT is called by exit1() or execve(), in + * both cases other threads must be retired. */ + KASSERT(p->p_numthreads == 1, ("Unthreading with >1 threads")); p->p_singlethread = NULL; - p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); - thread_unthread(td); + p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_HADTHREADS); /* * Wait for any remaining threads to exit cpu_throw(). diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 374a4dc..72b2a9f 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -956,7 +956,6 @@ void thread_suspend_one(struct thread *td); void thread_unlink(struct thread *td); void thread_unsuspend(struct proc *p); int thread_unsuspend_one(struct thread *td); -void thread_unthread(struct thread *td); void thread_wait(struct proc *p); struct thread *thread_find(struct proc *p, lwpid_t tid); |