diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-06-21 10:59:44 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-06-21 10:59:44 +0200 |
commit | 5d7b51995eab6b609a1f1e58dc3e3f5a5df73b8d (patch) | |
tree | ebc5ab1e7ec09fccc7c6daaf8dedaa20f4bf231a /libgomp | |
parent | 0841534abdf8bd06c42c5ae0293fb01d25b3e7b3 (diff) | |
download | gcc-5d7b51995eab6b609a1f1e58dc3e3f5a5df73b8d.zip gcc-5d7b51995eab6b609a1f1e58dc3e3f5a5df73b8d.tar.gz gcc-5d7b51995eab6b609a1f1e58dc3e3f5a5df73b8d.tar.bz2 |
critical.c (GOMP_critical_name_start): Fix *pptr initialization when gomp_mutex_t is larger than pointer and...
* critical.c (GOMP_critical_name_start): Fix *pptr initialization
when gomp_mutex_t is larger than pointer and HAVE_SYNC_BUILTINS is
defined.
From-SVN: r114843
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 6 | ||||
-rw-r--r-- | libgomp/critical.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index dc86f86..8cd5519 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2006-06-21 Jakub Jelinek <jakub@redhat.com> + + * critical.c (GOMP_critical_name_start): Fix *pptr initialization + when gomp_mutex_t is larger than pointer and HAVE_SYNC_BUILTINS is + defined. + 2006-06-20 Jakub Jelinek <jakub@redhat.com> PR libgomp/26175 diff --git a/libgomp/critical.c b/libgomp/critical.c index 70159ec..9082163 100644 --- a/libgomp/critical.c +++ b/libgomp/critical.c @@ -72,12 +72,14 @@ GOMP_critical_name_start (void **pptr) gomp_mutex_t *nlock = gomp_malloc (sizeof (gomp_mutex_t)); gomp_mutex_init (nlock); - plock = __sync_val_compare_and_swap (pptr, plock, nlock); - if (plock != nlock) + plock = __sync_val_compare_and_swap (pptr, NULL, nlock); + if (plock != NULL) { gomp_mutex_destroy (nlock); free (nlock); } + else + plock = nlock; #else gomp_mutex_lock (&create_lock_lock); plock = *pptr; |