[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 00:30:51 PST 2017


EricWF added inline comments.


================
Comment at: include/__threading_support:79
+
+  template <typename _Mutex = __libcpp_mutex_t,
+            typename _RecursiveMutex = __libcpp_recursive_mutex_t,
----------------
This uses C++11 features but is limited to C++03.


================
Comment at: include/__threading_support:91
+  {
+    return reinterpret_cast<__libcpp_mutex_t*>(__value);
+  }
----------------
Wouldn't a `static_cast` be valid here?


================
Comment at: include/__threading_support:110
+int __libcpp_mutex_lock(__libcpp_mutex_reference&& __m);
 
 _LIBCPP_THREAD_ABI_VISIBILITY
----------------
This uses C++11 features but is limited to C++03. Although we can technically cheat and use Clang extended rvalue references here.


================
Comment at: include/__threading_support:112
 _LIBCPP_THREAD_ABI_VISIBILITY
-int __libcpp_mutex_trylock(__libcpp_mutex_t *__m);
+int __libcpp_mutex_trylock(__libcpp_mutex_reference&& __m);
 
----------------
Won't we ever want to pass an lvalue here?


Repository:
  rL LLVM

https://reviews.llvm.org/D28226





More information about the cfe-commits mailing list