diff options
author | Josh Gao <jmgao@google.com> | 2017-08-02 14:42:39 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-08-02 14:44:58 -0700 |
commit | e4509da961057b94bc42e71d8dcd948cae261ba8 (patch) | |
tree | 1a019f28537c64455cd059e3c36021d9d8fd2d36 /base/include/android-base | |
parent | 420eabe3b3289eadb7ca72967e4c23932db02f5a (diff) | |
download | system_core-e4509da961057b94bc42e71d8dcd948cae261ba8.tar.gz system_core-e4509da961057b94bc42e71d8dcd948cae261ba8.tar.bz2 system_core-e4509da961057b94bc42e71d8dcd948cae261ba8.zip |
base: work around thread safety analysis bug.
Clang's assert_capability and assert_shared_capability annotations are
nonfunctional until https://reviews.llvm.org/rL309725 is relanded and
makes its way into our toolchain. Work around this by using the
equivalent assert_lock and assert_shared_lock.
Bug: http://b/64226736
Test: manual
Change-Id: I40711f162ea1d492f1e0b3eff88bf6ae6d995e2f
Diffstat (limited to 'base/include/android-base')
-rw-r--r-- | base/include/android-base/thread_annotations.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/base/include/android-base/thread_annotations.h b/base/include/android-base/thread_annotations.h index fbb592336..65eb015c3 100644 --- a/base/include/android-base/thread_annotations.h +++ b/base/include/android-base/thread_annotations.h @@ -71,11 +71,12 @@ #define EXCLUDES(...) \ THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__)) +// b/64226736: assert_capability and assert_shared_capability are non-functional. #define ASSERT_CAPABILITY(x) \ - THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x)) + THREAD_ANNOTATION_ATTRIBUTE__(assert_lock(x)) #define ASSERT_SHARED_CAPABILITY(x) \ - THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x)) + THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(x)) #define RETURN_CAPABILITY(x) \ THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) |