summaryrefslogtreecommitdiff
path: root/libgomp/critical.c
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-30 04:02:53 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-30 04:02:53 +0000
commita28ddb67e7d93f5ba095c28af9a14b991b2cbcfd (patch)
treef2b455abcdef142ecdfee68c7c0c647af19edcdd /libgomp/critical.c
parentdf17b94dcaa40e7e13e24a2a8ce6984d70254692 (diff)
downloadgcc-a28ddb67e7d93f5ba095c28af9a14b991b2cbcfd.tar.gz
* ordered.c (gomp_ordered_sync): Add MEMMODEL_ACQ_REL fence.
* critical.c (GOMP_critical_start): Add MEMMODEL_RELEASE fence. * config/linux/mutex.h: Use atomic rather than sync builtins. * config/linux/mutex.c: Likewise. Comment. Use -1 for waiting state. * config/linux/omp-lock.h: Comment fix. * config/linux/arm/mutex.h: Delete. * config/linux/powerpc/mutex.h: Delete. * config/linux/ia64/mutex.h: Delete. * config/linux/mips/mutex.h: Delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181832 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/critical.c')
-rw-r--r--libgomp/critical.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgomp/critical.c b/libgomp/critical.c
index daf1ffc2137..414c4221626 100644
--- a/libgomp/critical.c
+++ b/libgomp/critical.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2009, 2011 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
@@ -33,6 +33,8 @@ static gomp_mutex_t default_lock;
void
GOMP_critical_start (void)
{
+ /* There is an implicit flush on entry to a critical region. */
+ __atomic_thread_fence (MEMMODEL_RELEASE);
gomp_mutex_lock (&default_lock);
}