* 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
+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
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;