Date: Sat, 24 Sep 2005 01:19:53 +0000 (UTC) From: Brian Somers <brian@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libpthread/thread thr_init.c thr_kern.c Message-ID: <200509240119.j8O1JrSt041577@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <deischen@freebsd.org>
[_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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509240119.j8O1JrSt041577>
