Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2008 21:46:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185456 - head/lib/libthr/thread
Message-ID:  <200811292146.mATLkSee063322@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811292146.mATLkSee063322>