mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
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
This commit is contained in:
parent
bf7dcda366
commit
8626a0ddc6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271007
@ -548,18 +548,6 @@ thread_link(struct thread *td, struct proc *p)
|
||||
p->p_numthreads++;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 @@ thread_single(int mode)
|
||||
}
|
||||
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().
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user