diff src/share/vm/oops/instanceRefKlass.cpp @ 1934:7cf1a74771e8

6988439: Parallel Class Loading test deadlock involving MethodData_lock and Pending List Lock Summary: Don't acquire methodData_lock while holding pending list lock Reviewed-by: kvn, never, ysr
author coleenp
date Fri, 10 Dec 2010 12:13:03 -0500
parents f95d63e2154a
children b03e6b4c7c75
line wrap: on
line diff
--- a/src/share/vm/oops/instanceRefKlass.cpp	Thu Dec 09 20:12:06 2010 -0500
+++ b/src/share/vm/oops/instanceRefKlass.cpp	Fri Dec 10 12:13:03 2010 -0500
@@ -457,6 +457,11 @@
   }
 }
 
+bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
+  Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
+  return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
+}
+
 void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) {
   // we may enter this with pending exception set
   PRESERVE_EXCEPTION_MARK;  // exceptions are never thrown, needed for TRAPS argument