Fix potential race condition in OpenACC "exit data" operations
authorJulian Brown <julian@codesourcery.com>
Fri, 13 Dec 2019 23:14:15 +0000 (23:14 +0000)
committerJulian Brown <jules@gcc.gnu.org>
Fri, 13 Dec 2019 23:14:15 +0000 (23:14 +0000)
commit1cbd94e834d58100579847d35e899768c384dae0
treec17d82d0dc67d657c321886da4f4691306c4f3a6
parenta7c70129b9cb1cc9300400dc4f4adc639f0ba9c3
Fix potential race condition in OpenACC "exit data" operations

PR libgomp/92881

libgomp/
* libgomp.h (gomp_remove_var_async): Add prototype.
* oacc-mem.c (delete_copyout): Call gomp_remove_var_async instead of
gomp_remove_var.
* target.c (gomp_unref_tgt): Change return type to bool, indicating
whether target_mem_desc was unmapped.
(gomp_unref_tgt_void): New.
(gomp_remove_var): Reimplement in terms of...
(gomp_remove_var_internal): ...this new helper function.
(gomp_remove_var_async): New, implemented using above helper function.
(gomp_unmap_vars_internal): Use gomp_unref_tgt_void instead of
gomp_unref_tgt.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r279388
libgomp/ChangeLog
libgomp/libgomp.h
libgomp/oacc-mem.c
libgomp/target.c