Commit 5d7b5199 by Jakub Jelinek Committed by Jakub Jelinek

critical.c (GOMP_critical_name_start): Fix *pptr initialization when…

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
parent 0841534a
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> 2006-06-20 Jakub Jelinek <jakub@redhat.com>
PR libgomp/26175 PR libgomp/26175
......
...@@ -72,12 +72,14 @@ GOMP_critical_name_start (void **pptr) ...@@ -72,12 +72,14 @@ GOMP_critical_name_start (void **pptr)
gomp_mutex_t *nlock = gomp_malloc (sizeof (gomp_mutex_t)); gomp_mutex_t *nlock = gomp_malloc (sizeof (gomp_mutex_t));
gomp_mutex_init (nlock); gomp_mutex_init (nlock);
plock = __sync_val_compare_and_swap (pptr, plock, nlock); plock = __sync_val_compare_and_swap (pptr, NULL, nlock);
if (plock != nlock) if (plock != NULL)
{ {
gomp_mutex_destroy (nlock); gomp_mutex_destroy (nlock);
free (nlock); free (nlock);
} }
else
plock = nlock;
#else #else
gomp_mutex_lock (&create_lock_lock); gomp_mutex_lock (&create_lock_lock);
plock = *pptr; plock = *pptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment