From owner-svn-src-head@FreeBSD.ORG Sat Nov 29 21:46:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A72D9106564A; Sat, 29 Nov 2008 21:46:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D60C8FC14; Sat, 29 Nov 2008 21:46:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mATLkS62063323; Sat, 29 Nov 2008 21:46:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mATLkSee063322; Sat, 29 Nov 2008 21:46:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811292146.mATLkSee063322@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 29 Nov 2008 21:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185456 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2008 21:46:28 -0000 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. */