Forcibly unlock the malloc() locks in the child process after fork(),
by temporary pretending that the process is still multithreaded. Current malloc lock primitives do nothing for singlethreaded process. Reviewed by: davidxu, deischen
This commit is contained in:
parent
8392059492
commit
29986e1bac
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190025
@ -173,8 +173,11 @@ _fork(void)
|
||||
/* Ready to continue, unblock signals. */
|
||||
_thr_signal_unblock(curthread);
|
||||
|
||||
if (unlock_malloc)
|
||||
if (unlock_malloc) {
|
||||
__isthreaded = 1;
|
||||
_malloc_postfork();
|
||||
__isthreaded = 0;
|
||||
}
|
||||
|
||||
/* Run down atfork child handlers. */
|
||||
TAILQ_FOREACH(af, &_thr_atfork_list, qe) {
|
||||
|
Loading…
Reference in New Issue
Block a user