mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
After forking and initializing the library to single-threaded
mode (where the forked thread is the one and only thread and is marked as system scope), set the system scope flag before initializing the signal mask. This prevents trying to use internal locks that haven't yet been initialized. Reported by: Dan Nelson <dnelson at allantgroup.com> Reviewed by: davidxu
This commit is contained in:
parent
5b8ef52df0
commit
b8bbeeda02
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128041
@ -347,13 +347,14 @@ _kse_single_thread(struct pthread *curthread)
|
||||
_thr_signal_deinit();
|
||||
}
|
||||
__isthreaded = 0;
|
||||
curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
|
||||
curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
|
||||
|
||||
/*
|
||||
* Restore signal mask early, so any memory problems could
|
||||
* dump core.
|
||||
*/
|
||||
sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL);
|
||||
curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
|
||||
curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
|
||||
_thr_active_threads = 1;
|
||||
#endif
|
||||
}
|
||||
|
@ -347,13 +347,14 @@ _kse_single_thread(struct pthread *curthread)
|
||||
_thr_signal_deinit();
|
||||
}
|
||||
__isthreaded = 0;
|
||||
curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
|
||||
curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
|
||||
|
||||
/*
|
||||
* Restore signal mask early, so any memory problems could
|
||||
* dump core.
|
||||
*/
|
||||
sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL);
|
||||
curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
|
||||
curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
|
||||
_thr_active_threads = 1;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user