[PATCH] D14731: [libcxx] Add clang thread safety annotations to mutex and lock_guard

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 18:46:53 PDT 2016


EricWF added a comment.

So I fixed up LIT so that it also adds "-Werror=thread-safety" for both ".pass.cpp" and ".fail.cpp" tests. Could you apply it to your patch?
https://gist.github.com/EricWF/8a0bfb6ff02f8c9f9940


================
Comment at: include/__mutex_base:37
@@ -30,1 +36,3 @@
+
+class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
 {
----------------
Does `capability` have a alternative keyword that's a reserved name? ie `__capability__`? If so we should use that instead.


http://reviews.llvm.org/D14731





More information about the cfe-commits mailing list