From af62b44029c208376086940976cc386c9921f086 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 6 Oct 2008 16:47:10 +0000 Subject: * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier to force runp->refcntr to be read from memory. --- nptl/sysdeps/unix/sysv/linux/fork.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nptl') diff --git a/nptl/sysdeps/unix/sysv/linux/fork.c b/nptl/sysdeps/unix/sysv/linux/fork.c index 1683de8..524d72c 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 , 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) -- cgit v1.1