JDWP: fix thread_list deadlock
Limits the scope of Locks::thread_list_lock_ locking in the debugger
so we do not try to lock it twice when creating a JDWP id (because
calling Object::IdentityHashCode may need to take the lock).
Bug: 20048099
Change-Id: I305dd72ccc4d2d007d1603b0d52bcfa94b6842a7
diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h
index cfc8549..e44a40a 100644
--- a/runtime/mirror/object.h
+++ b/runtime/mirror/object.h
@@ -111,7 +111,10 @@
Object* Clone(Thread* self) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- int32_t IdentityHashCode() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ int32_t IdentityHashCode() const
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+ LOCKS_EXCLUDED(Locks::thread_list_lock_,
+ Locks::thread_suspend_count_lock_);
static MemberOffset MonitorOffset() {
return OFFSET_OF_OBJECT_MEMBER(Object, monitor_);