# HG changeset patch # User dholmes # Date 1409707628 14400 # Node ID 7dca5ed0e13d24420560a4d78ca067fa8e683aa9 # Parent 20c3c41c2b99bc53e363d09360a0be069fee718b 8046210: Missing memory barrier when reading init_lock Reviewed-by: fparain, dcubed, mdoerr Contributed-by: Bill Pittore diff -r 20c3c41c2b99 -r 7dca5ed0e13d src/share/vm/oops/instanceKlass.cpp --- a/src/share/vm/oops/instanceKlass.cpp Fri Sep 12 13:27:05 2014 -0700 +++ b/src/share/vm/oops/instanceKlass.cpp Tue Sep 02 21:27:08 2014 -0400 @@ -504,6 +504,8 @@ oop InstanceKlass::init_lock() const { // return the init lock from the mirror oop lock = java_lang_Class::init_lock(java_mirror()); + // Prevent reordering with any access of initialization state + OrderAccess::loadload(); assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state "only fully initialized state can have a null lock"); return lock;