aboutsummaryrefslogtreecommitdiff
path: root/libgomp/oacc-init.c
diff options
context:
space:
mode:
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)
{