Skip to content
Snippets Groups Projects
Commit f1e89bc3 authored by jakub's avatar jakub
Browse files

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

	when gomp_mutex_t is larger than pointer and HAVE_SYNC_BUILTINS is
	defined.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114843 138bc75d-0d04-0410-961f-82ee72b054a4
parent 1fc5c8af
No related merge requests found
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
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment