From owner-cvs-all@FreeBSD.ORG Thu Mar 16 23:29:09 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E7E416A422; Thu, 16 Mar 2006 23:29:09 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD98243D53; Thu, 16 Mar 2006 23:29:08 +0000 (GMT) (envelope-from deischen@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 k2GNT8Ke015854; Thu, 16 Mar 2006 23:29:08 GMT (envelope-from deischen@repoman.freebsd.org) Received: (from deischen@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2GNT8ws015853; Thu, 16 Mar 2006 23:29:08 GMT (envelope-from deischen) Message-Id: <200603162329.k2GNT8ws015853@repoman.freebsd.org> From: Daniel Eischen Date: Thu, 16 Mar 2006 23:29:08 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/lib/libpthread/arch/amd64/amd64 context.S src/lib/libpthread/arch/i386/i386 pthread_md.c src/lib/libpthread/test guard_b.c mutex_d.c sigsuspend_d.c src/lib/libpthread/thread thr_cond.c thr_init.c thr_kern.c thr_mutex.c thr_nanosleep.c thr_private.h ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2006 23:29:09 -0000 deischen 2006-03-16 23:29:08 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) lib/libpthread/arch/amd64/amd64 context.S lib/libpthread/arch/i386/i386 pthread_md.c lib/libpthread/test guard_b.c mutex_d.c sigsuspend_d.c lib/libpthread/thread thr_cond.c thr_init.c thr_kern.c thr_mutex.c thr_nanosleep.c thr_private.h thr_pspinlock.c thr_rtld.c thr_sem.c thr_sig.c thr_sigsuspend.c thr_symbols.c Log: MFC: Relevent commit logs are below. Only catch SIGINFO (for dumping thread states) when LIBPTHREAD_DEBUG is defined in the environment. 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. Eliminate a race condition in timed waits (cv, mutex, and sleeps). Don't forget to initialize a tailq before using it. For the ``#ifdef NOTYET'' code that allows calling non-async-safe functions in the child after a fork() from a threaded process, use __sys_setprocmask() rather than setprocmask() to keep our signal handling sane. Without this fix, signals are essentially ignored in said child and things such as protection violations result in an endless busy loop. Allocate a thread's tcb last so it is easier to handle failures to malloc() siginfo. Include needed headers that were obtained through . Sort headers while here. amd64 ----- Fix a race condition introduced when redzones were added. Use an atomic operation to return and adjust the stack (amd64). test ----- o Include o Make this ILP32/LP64 clean: cast pointers to long. Approved by: re (scottl) Revision Changes Path 1.7.8.1 +4 -5 src/lib/libpthread/arch/amd64/amd64/context.S 1.7.2.1 +0 -1 src/lib/libpthread/arch/i386/i386/pthread_md.c 1.2.14.1 +5 -3 src/lib/libpthread/test/guard_b.c 1.4.10.1 +14 -13 src/lib/libpthread/test/mutex_d.c 1.2.10.1 +1 -1 src/lib/libpthread/test/sigsuspend_d.c 1.52.2.1 +5 -5 src/lib/libpthread/thread/thr_cond.c 1.70.2.1 +3 -1 src/lib/libpthread/thread/thr_init.c 1.116.2.1 +32 -26 src/lib/libpthread/thread/thr_kern.c 1.47.2.1 +22 -24 src/lib/libpthread/thread/thr_mutex.c 1.24.8.1 +3 -1 src/lib/libpthread/thread/thr_nanosleep.c 1.123.2.1 +1 -0 src/lib/libpthread/thread/thr_private.h 1.2.10.1 +5 -2 src/lib/libpthread/thread/thr_pspinlock.c 1.5.10.1 +7 -5 src/lib/libpthread/thread/thr_rtld.c 1.16.2.1 +1 -0 src/lib/libpthread/thread/thr_sem.c 1.83.2.1 +25 -16 src/lib/libpthread/thread/thr_sig.c 1.26.2.1 +5 -2 src/lib/libpthread/thread/thr_sigsuspend.c 1.1.8.1 +1 -0 src/lib/libpthread/thread/thr_symbols.c