aboutsummaryrefslogtreecommitdiff
path: root/libgomp/oacc-init.c
diff options
context:
space:
mode:
authorjules <jules@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-06 16:45:49 +0000
committerjules <jules@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-06 16:45:49 +0000
commit09f66ac187dd482ab9b5e328ff38e7e7474ebb70 (patch)
tree28d8cb3a48d10ec0b8097a10ccfc88a1f46deba3 /libgomp/oacc-init.c
parent1ddaa252d0d1cbf4999cf0f8798fd9261447b693 (diff)
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222860 138bc75d-0d04-0410-961f-82ee72b054a4
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 dc40fb6ffe1..10722980fe8 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)
{