re PR libgomp/93065 (libgomp: destructor missing to delete goacc_cleanup_key)
authorAyush Mittal <ayush.m@samsung.com>
Tue, 31 Dec 2019 10:34:34 +0000 (10:34 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 31 Dec 2019 10:34:34 +0000 (11:34 +0100)
PR libgomp/93065
* oacc-init.c (goacc_runtime_deinitialize): New function.

From-SVN: r279803

libgomp/ChangeLog
libgomp/oacc-init.c

index 9eb3e2c25a033260485a89ff9be57eb292b5569f..a18868ba3fd799fd7897164610778e545751dffb 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-31  Ayush Mittal  <ayush.m@samsung.com>
+
+       PR libgomp/93065
+       * oacc-init.c (goacc_runtime_deinitialize): New function.
+
 2019-12-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/93074
index 487a2cca61f8779f4b93fb6361c175e5c6afae5c..6aa5fd297d6fcdd011a3be5e90a7766ba4a9bddc 100644 (file)
@@ -858,6 +858,15 @@ goacc_runtime_initialize (void)
   goacc_host_init ();
 }
 
+static void __attribute__((destructor))
+goacc_runtime_deinitialize (void)
+{
+#if !(defined HAVE_TLS || defined USE_EMUTLS)
+  pthread_key_delete (goacc_tls_key);
+#endif
+  pthread_key_delete (goacc_cleanup_key);
+}
+
 /* Compiler helper functions */
 
 attribute_hidden void