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

login
register
mail settings
Submitter Jakub Jelinek
Date Dec. 2, 2010, 2:39 p.m.
Message ID <20101202143942.GL29412@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/73976/
State New
Headers show

Comments

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

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