[PATCH] D24864: [libcxxabi] Refactor pthread usage into a separate API

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 16:31:46 PDT 2016


EricWF added a comment.

LGTM other than the inline comments. I'll give it a final once over tonight or tomorrow.


================
Comment at: include/__cxxabi_config.h:36
@@ -35,1 +35,3 @@
  #endif
+ #if defined(_MSC_VER) && !defined(__clang__)
+  // Using Microsoft Visual C++ compiler
----------------
Does this configuration need to be in a public header if it's only used internally? I think `config.h` or `threading_support.h` would be a better place for this to live.

================
Comment at: src/config.h:22
@@ +21,3 @@
+
+#if defined(__GNUC__) || defined(__clang__)
+#define _LIBCXXABI_PRAGMA(_parameter_) _Pragma(#_parameter_)
----------------
What's the point of defining `_LIBCXXABI_WARNING`? It's unused and seems unneeded.

================
Comment at: src/fallback_malloc.ipp:30
@@ -29,3 +29,3 @@
 #ifndef _LIBCXXABI_HAS_NO_THREADS
-static pthread_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER;
+static __libcxxabi_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER;
 #else
----------------
s/`PTHREAD_MUTEX_INITIALIZER`/`_LIBCXXABI_MUTEX_INITIALIZER`


https://reviews.llvm.org/D24864





More information about the cfe-commits mailing list