In parallel.c, if HAVE_SYNC_BUILTINS is #undef'ed, then GOMP_parallel_end uses a mutex to atomically modify the team->nthreads field. The mutex that is used to atomically write to nthreads is locked but never unlocked. parallel.c, GOMP_parallel_end: #ifdef HAVE_SYNC_BUILTINS __sync_fetch_and_add (&gomp_remaining_threads_count, 1UL - team->nthreads); #else gomp_mutex_lock (&gomp_remaining_threads_lock); gomp_remaining_threads_count -= team->nthreads - 1; #endif
Author: jakub Date: Thu Dec 2 14:30:37 2010 New Revision: 167370 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167370 Log: PR libgomp/45240 * parallel.c (GOMP_parallel_end): Unlock gomp_remaining_threads_lock at the end if sync builtins aren't supported. Modified: trunk/libgomp/ChangeLog trunk/libgomp/parallel.c
Author: jakub Date: Tue Dec 7 15:26:37 2010 New Revision: 167547 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167547 Log: Backport from mainline 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. Modified: branches/gcc-4_5-branch/libgomp/ChangeLog branches/gcc-4_5-branch/libgomp/parallel.c
Fixed.
Author: jakub Date: Tue Dec 7 18:59:03 2010 New Revision: 167560 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167560 Log: Backport from mainline 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. Modified: branches/gcc-4_4-branch/libgomp/ChangeLog branches/gcc-4_4-branch/libgomp/parallel.c