[PATCH] D19412: [libcxx] Refactor pthread usage - II

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 28 12:55:36 PDT 2016


EricWF added a comment.

The patch looks good for the most part. Nit picking I would rather have `__libcpp_thread_foo` instead of `__libcpp_os_support::__os_thread_foo`. IMO the namespace is undeeded.
@mclow.lists can you weigh in on this?


================
Comment at: include/__mutex_base:43
@@ -43,3 +42,3 @@
 #ifndef _LIBCPP_HAS_NO_CONSTEXPR
-     constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
+    constexpr mutex() _NOEXCEPT : __m_(__OS_MUTEX_INITIALIZER) {}
 #else
----------------
Similar to the reason we choose `__libcpp_mutex` these macros should have a `_LIBCPP` prefix as well instead of an `_OS` one.



================
Comment at: include/__mutex_base:285
@@ -284,3 +284,3 @@
 #else
-    condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
+    condition_variable() {__cv_ = (__libcpp_condvar)__OS_COND_INITIALIZER;}
 #endif
----------------
Shouldn't this be `__cond_var_type`?


http://reviews.llvm.org/D19412





More information about the cfe-commits mailing list