diff mbox

[committed] Fix GOMP_parallel_end without sync builtins (PR libgomp/45240)

Message ID 20101202143942.GL29412@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Dec. 2, 2010, 2:39 p.m. UTC
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.


	Jakub
diff mbox

Patch

--- 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
 	}
     }