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

James Robinson via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 11:11:47 PST 2016


jamesr added a comment.

Ah, that's true.  I didn't think of that case.  With the design of these annotations the author of that function would have to disable checks in each piece of code that uses these patterns.

What about adding a different guard for these annotations in libc++ that consumers could choose to toggle independently of the -Wthread-safety compiler option?  That way consumers could choose to enable the libc++ annotations if their codebase was compatible with them.  The alternative is that consumers have to fully wrap the std:: types in their own types to add the annotations which works but makes code reuse very difficult.


http://reviews.llvm.org/D14731





More information about the cfe-commits mailing list