This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix GOMP_parallel_end without sync builtins (PR libgomp/45240)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 Dec 2010 15:39:42 +0100
- Subject: [committed] Fix GOMP_parallel_end without sync builtins (PR libgomp/45240)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
When libgomp is compiled on target without sync builtins,
we weren't unlocking gomp_remaining_threads_lock at the end of
GOMP_parallel_end. Fixed thusly, committed (so far) to the trunk.
2010-12-02 Jakub Jelinek <jakub@redhat.com>
PR libgomp/45240
* parallel.c (GOMP_parallel_end): Unlock gomp_remaining_threads_lock
at the end if sync builtins aren't supported.
--- libgomp/parallel.c.jj 2009-04-14 16:33:07.000000000 +0200
+++ libgomp/parallel.c 2010-12-02 09:29:26.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
@@ -123,6 +123,7 @@ GOMP_parallel_end (void)
#else
gomp_mutex_lock (&gomp_remaining_threads_lock);
gomp_remaining_threads_count -= team->nthreads - 1;
+ gomp_mutex_unlock (&gomp_remaining_threads_lock);
#endif
}
}
Jakub