mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Fix panic, triggered like this: "int main() { thr_exit(); }"
Submitted by: Mateusz Guzik
This commit is contained in:
parent
786813aa1f
commit
47f6635cc1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234381
@ -317,13 +317,13 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
|
||||
rw_wlock(&tidhash_lock);
|
||||
|
||||
PROC_LOCK(p);
|
||||
racct_sub(p, RACCT_NTHR, 1);
|
||||
|
||||
/*
|
||||
* Shutting down last thread in the proc. This will actually
|
||||
* call exit() in the trampoline when it returns.
|
||||
*/
|
||||
if (p->p_numthreads != 1) {
|
||||
racct_sub(p, RACCT_NTHR, 1);
|
||||
LIST_REMOVE(td, td_hash);
|
||||
rw_wunlock(&tidhash_lock);
|
||||
tdsigcleanup(td);
|
||||
|
Loading…
Reference in New Issue
Block a user