[PATCH] D52251: [builtins] Add __emutls_unregister_key function

Yi Kong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 15:23:24 PDT 2018


kongyi created this revision.
kongyi added reviewers: rprichard, chh, srhines.
Herald added subscribers: Sanitizers, llvm-commits, jfb.

This is called by Bionic on dlclose to delete the emutls pthread key.

The return value of `pthread_key_delete` is unchecked and behaviour of multiple calls to the method is dependent on the implementation of `pthread_key_delete`.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D52251

Files:
  lib/builtins/emutls.c


Index: lib/builtins/emutls.c
===================================================================
--- lib/builtins/emutls.c
+++ lib/builtins/emutls.c
@@ -390,3 +390,10 @@
         array->data[index] = emutls_allocate_object(control);
     return array->data[index];
 }
+
+#ifdef __BIONIC__
+__attribute__((visibility("hidden")))
+void __emutls_unregister_key(void) {
+    pthread_key_delete(emutls_pthread_key);
+}
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52251.166043.patch
Type: text/x-patch
Size: 422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/2addb8b3/attachment.bin>


More information about the llvm-commits mailing list