]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
authorUlrich Drepper <drepper@redhat.com>
Mon, 6 Oct 2008 16:47:10 +0000 (16:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 6 Oct 2008 16:47:10 +0000 (16:47 +0000)
to force runp->refcntr to be read from memory.

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

index 9dd19f1575c1e6e09763f5a7850ba3c56bd52a56..8a37b4a0fa9ad8414a6b3ec64cf74a799446146c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+       * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
+       to force runp->refcntr to be read from memory.
+
 2008-09-18  Andreas Schwab  <schwab@suse.de>
 
        [BZ #6942]
index 1683de80fdf81a95e9f65e66e707440374743051..524d72c5874eab52427403e28dbde4219509b5d5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -64,6 +64,9 @@ __libc_fork (void)
   struct fork_handler *runp;
   while ((runp = __fork_handlers) != NULL)
     {
+      /* Make sure we read from the current RUNP pointer.  */
+      atomic_full_barrier ();
+
       unsigned int oldval = runp->refcntr;
 
       if (oldval == 0)