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

Daniel Eischen deischen at
Thu Mar 16 23:29:09 UTC 2006

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 
  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 <pthread.h>.  Sort headers
    while here.
    Fix a race condition introduced when redzones were added.  Use an
    atomic operation to return and adjust the stack (amd64).
    o  Include <string.h>
    o  Make this ILP32/LP64 clean: cast pointers to long.
  Approved by:    re (scottl)
  Revision   Changes    Path    +4 -5      src/lib/libpthread/arch/amd64/amd64/context.S    +0 -1      src/lib/libpthread/arch/i386/i386/pthread_md.c   +5 -3      src/lib/libpthread/test/guard_b.c   +14 -13    src/lib/libpthread/test/mutex_d.c   +1 -1      src/lib/libpthread/test/sigsuspend_d.c   +5 -5      src/lib/libpthread/thread/thr_cond.c   +3 -1      src/lib/libpthread/thread/thr_init.c  +32 -26    src/lib/libpthread/thread/thr_kern.c   +22 -24    src/lib/libpthread/thread/thr_mutex.c   +3 -1      src/lib/libpthread/thread/thr_nanosleep.c  +1 -0      src/lib/libpthread/thread/thr_private.h   +5 -2      src/lib/libpthread/thread/thr_pspinlock.c   +7 -5      src/lib/libpthread/thread/thr_rtld.c   +1 -0      src/lib/libpthread/thread/thr_sem.c   +25 -16    src/lib/libpthread/thread/thr_sig.c   +5 -2      src/lib/libpthread/thread/thr_sigsuspend.c    +1 -0      src/lib/libpthread/thread/thr_symbols.c

More information about the cvs-src mailing list