aboutsummaryrefslogtreecommitdiff
path: root/libgomp/oacc-init.c
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2015-05-06 16:45:49 +0000
committerJulian Brown <jules@gcc.gnu.org>2015-05-06 16:45:49 +0000
commite38fdba42b1380d32845b3891a3e0deb4b653e1a (patch)
tree28d8cb3a48d10ec0b8097a10ccfc88a1f46deba3 /libgomp/oacc-init.c
parent5a0ff57c48cbaeedfac667d5e808baca8dbcb83c (diff)
downloadgcc-e38fdba42b1380d32845b3891a3e0deb4b653e1a.zip
gcc-e38fdba42b1380d32845b3891a3e0deb4b653e1a.tar.gz
gcc-e38fdba42b1380d32845b3891a3e0deb4b653e1a.tar.bz2
oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for goacc_thread_lock on error paths.
* oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for goacc_thread_lock on error paths. * oacc-mem.c (lookup_host): Remove locking from function. Note locking requirement for caller in function comment. (lookup_dev): Likewise. (acc_free, acc_deviceptr, acc_hostptr, acc_is_present) (acc_map_data, acc_unmap_data, present_create_copy, delete_copyout) (update_dev_host, gomp_acc_insert_pointer, gomp_acc_remove_pointer): Add locking. From-SVN: r222860
Diffstat (limited to 'libgomp/oacc-init.c')
-rw-r--r--libgomp/oacc-init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index dc40fb6..1072298 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -217,11 +217,17 @@ acc_shutdown_1 (acc_device_t d)
/* This would mean the user is shutting down OpenACC in the middle of an
"acc data" pragma. Likely not intentional. */
if (walk->mapped_data)
- gomp_fatal ("shutdown in 'acc data' region");
+ {
+ gomp_mutex_unlock (&goacc_thread_lock);
+ gomp_fatal ("shutdown in 'acc data' region");
+ }
/* Similarly, if this happens then user code has done something weird. */
if (walk->saved_bound_dev)
- gomp_fatal ("shutdown during host fallback");
+ {
+ gomp_mutex_unlock (&goacc_thread_lock);
+ gomp_fatal ("shutdown during host fallback");
+ }
if (walk->dev)
{