n = splay_tree_lookup (&acc_dev->mem_map, &cur_node);
if (n == NULL)
- gomp_fatal ("struct not mapped for acc_attach");
+ {
+ gomp_mutex_unlock (&acc_dev->lock);
+ gomp_fatal ("struct not mapped for acc_attach");
+ }
gomp_attach_pointer (acc_dev, aq, &acc_dev->mem_map, n, (uintptr_t) hostaddr,
0, NULL);
n = splay_tree_lookup (&acc_dev->mem_map, &cur_node);
if (n == NULL)
- gomp_fatal ("struct not mapped for acc_detach");
+ {
+ gomp_mutex_unlock (&acc_dev->lock);
+ gomp_fatal ("struct not mapped for acc_detach");
+ }
gomp_detach_pointer (acc_dev, aq, n, (uintptr_t) hostaddr, finalize, NULL);