aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-10-06 16:47:10 +0000
committerUlrich Drepper <drepper@redhat.com>2008-10-06 16:47:10 +0000
commitaf62b44029c208376086940976cc386c9921f086 (patch)
tree60dc5c4695a62b78a6c80d81238859d63a2f327b
parent2fdde3b920702b10edcd1771f5564ca58f2aa900 (diff)
downloadglibc-af62b44029c208376086940976cc386c9921f086.tar
glibc-af62b44029c208376086940976cc386c9921f086.tar.gz
glibc-af62b44029c208376086940976cc386c9921f086.tar.bz2
glibc-af62b44029c208376086940976cc386c9921f086.zip
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
to force runp->refcntr to be read from memory.
-rw-r--r--ChangeLog5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/fork.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9dd19f1575..8a37b4a0fa 100644
--- 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]
diff --git a/nptl/sysdeps/unix/sysv/linux/fork.c b/nptl/sysdeps/unix/sysv/linux/fork.c
index 1683de80fd..524d72c587 100644
--- a/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -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)