summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sebastien Hertz <shertz@google.com> 2014-09-08 10:15:19 +0200
committer Sebastien Hertz <shertz@google.com> 2014-09-09 09:48:17 +0200
commitc7376cabb889eb49cbd2dd9a77d10ee63a53d5b5 (patch)
tree09fef7a9ceb03b21ffa0bbe59485d6b1c9dfdc4d
parent38510082135a7fb438afb515fa3174596e644e9b (diff)
Fix monitor visit for class initializer
We do not hold class object's lock when invoking class initializer. Therefore it is wrong to visit it when looking for monitors owned by a thread. Bug: 17377924 (cherry picked from commit 6d06f1b34322d91226c9dcd61e53c2b6731f8bb6) Change-Id: I9a18c421297608dc3109624111f9fea021a16d24
-rw-r--r--runtime/monitor.cc6
1 files changed, 0 insertions, 6 deletions
diff --git a/runtime/monitor.cc b/runtime/monitor.cc
index a87d7c1fee..6123934d3c 100644
--- a/runtime/monitor.cc
+++ b/runtime/monitor.cc
@@ -965,12 +965,6 @@ void Monitor::VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::O
return;
}
- // <clinit> is another special case. The runtime holds the class lock while calling <clinit>.
- if (m->IsClassInitializer()) {
- callback(m->GetDeclaringClass(), callback_context);
- // Fall through because there might be synchronization in the user code too.
- }
-
// Is there any reason to believe there's any synchronization in this method?
const DexFile::CodeItem* code_item = m->GetCodeItem();
CHECK(code_item != NULL) << PrettyMethod(m);