svn commit: r185456 - head/lib/libthr/thread

Konstantin Belousov kib at FreeBSD.org
Sat Nov 29 13:46:28 PST 2008


Author: kib
Date: Sat Nov 29 21:46:28 2008
New Revision: 185456
URL: http://svn.freebsd.org/changeset/base/185456

Log:
  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

Modified:
  head/lib/libthr/thread/thr_fork.c

Modified: head/lib/libthr/thread/thr_fork.c
==============================================================================
--- head/lib/libthr/thread/thr_fork.c	Sat Nov 29 21:42:13 2008	(r185455)
+++ head/lib/libthr/thread/thr_fork.c	Sat Nov 29 21:46:28 2008	(r185456)
@@ -172,6 +172,7 @@ _fork(void)
 
 		if (unlock_malloc) {
 			_rtld_atfork_post(rtld_locks);
+			_malloc_postfork();
 		}
 
 		/* Run down atfork child handlers. */


More information about the svn-src-head mailing list