7006471: fix for 6988439 crashes when pending list lock is null
authorcoleenp
Tue, 14 Dec 2010 15:10:52 -0500
changeset 7450 e44c68293be8
parent 7449 d226d0eb0ff2
child 7451 cc12e11b1e07
child 7452 b3fa838286de
child 7692 02c573fae027
child 7697 7c49699784f0
7006471: fix for 6988439 crashes when pending list lock is null Summary: missing null check in owns_pending_list_lock() because this can be called before pending_list_lock is initialized. Reviewed-by: never, kvn
hotspot/src/share/vm/oops/instanceRefKlass.cpp
--- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Mon Dec 13 14:46:51 2010 -0800
+++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp	Tue Dec 14 15:10:52 2010 -0500
@@ -458,6 +458,7 @@
 }
 
 bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
+  if (java_lang_ref_Reference::pending_list_lock() == NULL) return false;
   Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
   return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
 }