[PATCH] D52251: [builtins] Add __emutls_unregister_key function

Yi Kong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 19 15:01:27 PDT 2018


kongyi added inline comments.


================
Comment at: lib/builtins/emutls.c:394
+
+#ifdef __BIONIC__
+__attribute__((visibility("hidden")))
----------------
chh wrote:
> I think this function should be useful to other non-bionic platform too.
> Did you get any link error with compiler-rt tests?
> 
No link error.

Other platforms don't need this for dlclose; it is Bionic specific.


================
Comment at: lib/builtins/emutls.c:397
+void __emutls_unregister_key(void) {
+    pthread_key_delete(emutls_pthread_key);
+}
----------------
chh wrote:
> Shouldn't this be called only after the pthread key was created?
> gcc's version has a flag emutls_key_created set only after emutls_init.
> 
> 
We don't need to check this, since emutls_key_delete is not expensive to call and we can safely ignore failure from it.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D52251





More information about the llvm-commits mailing list