summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-11-29 21:46:28 +0000
committerkib <kib@FreeBSD.org>2008-11-29 21:46:28 +0000
commit58f888b28c6991ea1def089a22338da9dec097c3 (patch)
treee7d65ff8625eb6c6eb857a67c7cc3ccf4c921bd0
parent3e94b73b94aaf0d6f7e3baf4830e4185f90142fa (diff)
downloadFreeBSD-src-58f888b28c6991ea1def089a22338da9dec097c3.zip
FreeBSD-src-58f888b28c6991ea1def089a22338da9dec097c3.tar.gz
Unlock the malloc() locks in the child process after fork(). This gives
us working malloc in the fork child of the multithreaded process. Although POSIX requires that only async-signal safe functions shall be operable after fork in multithreaded process, not having malloc lower the quality of our implementation. Tested by: rink Discussed with: kan, davidxu Reviewed by: kan MFC after: 1 month
-rw-r--r--lib/libthr/thread/thr_fork.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_fork.c b/lib/libthr/thread/thr_fork.c
index e16f884..18a9a05 100644
--- a/lib/libthr/thread/thr_fork.c
+++ b/lib/libthr/thread/thr_fork.c
@@ -172,6 +172,7 @@ _fork(void)
if (unlock_malloc) {
_rtld_atfork_post(rtld_locks);
+ _malloc_postfork();
}
/* Run down atfork child handlers. */
OpenPOWER on IntegriCloud