summaryrefslogtreecommitdiff
path: root/runtime/class_table-inl.h
diff options
context:
space:
mode:
author Alexey Grebenkin <a.grebenkin@samsung.com> 2018-02-01 19:09:59 +0300
committer Nicolas Geoffray <ngeoffray@google.com> 2018-03-15 14:57:09 +0000
commitab2ce84d4995f05c38c5ebfefc6683b244a36260 (patch)
treed094cd4b6456500bbe0b59859ae533f064b061a7 /runtime/class_table-inl.h
parent056967eb7e08d2c22f99aea52f871c2d018a373b (diff)
Fix dangling SingleImplementations left after class unloading
Test: make test-art-host, manual using sample code bug: 73143991 (cherry picked from commit be4c2bd892bd167a50b4dfa7133e70a809197698) Change-Id: I5f4d726334a9ea306d93b967966c58111fd34fd1
Diffstat (limited to 'runtime/class_table-inl.h')
-rw-r--r--runtime/class_table-inl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h
index 718e93a97d..c59e2e881d 100644
--- a/runtime/class_table-inl.h
+++ b/runtime/class_table-inl.h
@@ -60,12 +60,12 @@ void ClassTable::VisitRoots(const Visitor& visitor) {
}
}
-template <typename Visitor>
+template <typename Visitor, ReadBarrierOption kReadBarrierOption>
bool ClassTable::Visit(Visitor& visitor) {
ReaderMutexLock mu(Thread::Current(), lock_);
for (ClassSet& class_set : classes_) {
for (TableSlot& table_slot : class_set) {
- if (!visitor(table_slot.Read())) {
+ if (!visitor(table_slot.Read<kReadBarrierOption>())) {
return false;
}
}
@@ -73,12 +73,12 @@ bool ClassTable::Visit(Visitor& visitor) {
return true;
}
-template <typename Visitor>
+template <typename Visitor, ReadBarrierOption kReadBarrierOption>
bool ClassTable::Visit(const Visitor& visitor) {
ReaderMutexLock mu(Thread::Current(), lock_);
for (ClassSet& class_set : classes_) {
for (TableSlot& table_slot : class_set) {
- if (!visitor(table_slot.Read())) {
+ if (!visitor(table_slot.Read<kReadBarrierOption>())) {
return false;
}
}