]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2007-02-25 Ulrich Drepper <drepper@redhat.com>
authorJakub Jelinek <jakub@redhat.com>
Thu, 12 Jul 2007 15:40:54 +0000 (15:40 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 12 Jul 2007 15:40:54 +0000 (15:40 +0000)
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
new thread, don't just decrement it.
Patch by Suzuki K P <suzuki@in.ibm.com>.

nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/fork.c

index 6fa76ca4e57ef6caa22e2ffb2bfc0a38c6a8e0e4..a3ba15dc8d1f98423ae3f45d6c13a4b7915167e4 100644 (file)
        * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
        * tst-cancel4.c (tf_fdatasync): New test.
 
+2007-02-25  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
+       new thread, don't just decrement it.
+       Patch by Suzuki K P <suzuki@in.ibm.com>.
+
 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 840974401bc9fd24c5ab761862a2e5086cc78ad7..f6691e134461580383e9fc257835cb2920bc8963 100644 (file)
@@ -167,8 +167,11 @@ __libc_fork (void)
            allp->handler->child_handler ();
 
          /* Note that we do not have to wake any possible waiter.
-            This is the only thread in the new process.  */
-         --allp->handler->refcntr;
+            This is the only thread in the new process.  The count
+            may have been bumped up by other threads doing a fork.
+            We reset it to 1, to avoid waiting for non-existing
+            thread(s) to release the count.  */
+         allp->handler->refcntr = 1;
 
          /* XXX We could at this point look through the object pool
             and mark all objects not on the __fork_handlers list as