backport: re PR libgomp/67141 (wrong libgomp mutex initialisation order)

2015-09-22  Chung-Lin Tang  <cltang@codesourcery.com>

	Backport from mainline:

	2015-09-22  Chung-Lin Tang  <cltang@codesourcery.com>

	PR libgomp/67141
	* oacc-int.h (goacc_host_init): Add declaration.
	* oacc-host.c (goacc_host_init): Remove static and constructor attribute.
	* oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end.

From-SVN: r228011
This commit is contained in:
Chung-Lin Tang 2015-09-22 11:18:23 +00:00 committed by Chung-Lin Tang
parent 61cef8a14c
commit 0ee5fd6fe3
4 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,14 @@
2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
Backport from mainline:
2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
PR libgomp/67141
* oacc-int.h (goacc_host_init): Add declaration.
* oacc-host.c (goacc_host_init): Remove static and constructor attribute.
* oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end.
2015-08-24 Joost VandeVondele <vondele@gnu.gcc.org>
PR libgomp/66761

View File

@ -82,8 +82,8 @@ static struct gomp_device_descr host_dispatch =
};
/* Register this device type. */
static __attribute__ ((constructor))
void goacc_host_init (void)
void
goacc_host_init (void)
{
gomp_mutex_init (&host_dispatch.lock);
goacc_register (&host_dispatch);

View File

@ -580,6 +580,9 @@ goacc_runtime_initialize (void)
goacc_threads = NULL;
gomp_mutex_init (&goacc_thread_lock);
/* Initialize and register the 'host' device type. */
goacc_host_init ();
}
/* Compiler helper functions */

View File

@ -97,6 +97,7 @@ void goacc_runtime_initialize (void);
void goacc_save_and_set_bind (acc_device_t);
void goacc_restore_bind (void);
void goacc_lazy_initialize (void);
void goacc_host_init (void);
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility pop