cvs commit: src/lib/libpthread/thread thr_init.c thr_kern.c

Brian Somers brian at FreeBSD.org
Fri Sep 23 18:19:55 PDT 2005


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 at 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


More information about the cvs-all mailing list