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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 07:10:11 PST 2015


aaron.ballman added a comment.

In http://reviews.llvm.org/D14731#300074, @jamesr wrote:

> It looks like Aaron Ballman was involved with adding parsing for these attributes in clang - perhaps he has an idea of a better way to detect these than __has_attribute(acquire_capability).


__has_attribute is a reasonable approach. You are correct that there is (unfortunately) no good feature testing macro for these. The good news is, the attributes are relatively stable these days, and have been for a while.

FWIW, the annotations all LGTM.

~Aaron


http://reviews.llvm.org/D14731





More information about the cfe-commits mailing list