Use static thread safety analysis when available, and fix the bugs GCC finds.
It's impossible to express the Heap locking and the ThreadList locking with
GCC, but Clang is supposed to be able to do it. This patch does what's possible
for now.
Change-Id: Ib64a890c9d27c6ce255d5003cb755c2ef1beba95
diff --git a/src/intern_table.h b/src/intern_table.h
index 58d87d0..04c75d0 100644
--- a/src/intern_table.h
+++ b/src/intern_table.h
@@ -76,9 +76,9 @@
void Remove(Table& table, const String* s, uint32_t hash_code);
mutable Mutex intern_table_lock_;
- Table image_strong_interns_;
- Table strong_interns_;
- Table weak_interns_;
+ Table image_strong_interns_ GUARDED_BY(intern_table_lock_);
+ Table strong_interns_ GUARDED_BY(intern_table_lock_);
+ Table weak_interns_ GUARDED_BY(intern_table_lock_);
};
} // namespace art