From 58f888b28c6991ea1def089a22338da9dec097c3 Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 29 Nov 2008 21:46:28 +0000 Subject: 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 --- lib/libthr/thread/thr_fork.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libthr/thread/thr_fork.c') 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. */ -- cgit v1.1