From owner-cvs-src@FreeBSD.ORG Sat Sep 24 01:19:55 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1630C16A41F; Sat, 24 Sep 2005 01:19:55 +0000 (GMT) (envelope-from brian@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD86343D6D; Sat, 24 Sep 2005 01:19:53 +0000 (GMT) (envelope-from brian@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8O1JrM0041578; Sat, 24 Sep 2005 01:19:53 GMT (envelope-from brian@repoman.freebsd.org) Received: (from brian@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8O1JrSt041577; Sat, 24 Sep 2005 01:19:53 GMT (envelope-from brian) Message-Id: <200509240119.j8O1JrSt041577@repoman.freebsd.org> From: Brian Somers Date: Sat, 24 Sep 2005 01:19:53 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libpthread/thread thr_init.c thr_kern.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Sep 2005 01:19:55 -0000 brian 2005-09-24 01:19:53 UTC FreeBSD src repository Modified files: lib/libpthread/thread thr_init.c thr_kern.c Log: Modify the code path of the ifdef NOTYET part of _kse_single_thread(): o Don't reinitialise the atfork() handler list in the child. We are meant to call the child handler, and on subsequent fork()s should call all three functions as normal. o Don't reinitialise the thread specific keyed data in the child after a fork. Applications may require this for context. o Reinitialise curthread->tlflags after removing ourselves from (and reinitialising) the various internal thread lists. o Reinitialise __malloc_lock in the child after fork() (to balance our explicitly taking the lock prior to the fork()). With these changes, it is possible to enable the NOTYET code in thr_kern.c to allow the use of non-async-safe functions after fork()ing from a threaded program. Reviewed by: Daniel Eischen [_malloc_lock reinitialisation has since been moved to avoid polluting the !NOTYET code] Revision Changes Path 1.71 +1 -1 src/lib/libpthread/thread/thr_init.c 1.119 +10 -7 src/lib/libpthread/thread/thr_kern.c