[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r1574 - in /fsf/trunk/libc/nptl: ChangeLog sysdeps/unix/sysv/linux/fork.c



Author: eglibc
Date: Mon Feb 26 00:02:03 2007
New Revision: 1574

Log:
Import glibc-mainline for 2007-02-26

Modified:
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Mon Feb 26 00:02:03 2007
@@ -1,3 +1,9 @@
+2007-02-25  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
+	new thread, don't just decrement it.
+	Patch by Suzuki K P <suzuki@xxxxxxxxxx>.
+
 2007-02-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/pthread/pthread-functions.h: Correct last patch, correct

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c Mon Feb 26 00:02:03 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -167,8 +167,11 @@
 	    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