Tue, 02 Sep 2014 21:27:08 -0400
8046210: Missing memory barrier when reading init_lock
Reviewed-by: fparain, dcubed, mdoerr
Contributed-by: Bill Pittore <bill.pittore@oracle.com>
src/share/vm/oops/instanceKlass.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/oops/instanceKlass.cpp Fri Sep 12 13:27:05 2014 -0700 1.2 +++ b/src/share/vm/oops/instanceKlass.cpp Tue Sep 02 21:27:08 2014 -0400 1.3 @@ -504,6 +504,8 @@ 1.4 oop InstanceKlass::init_lock() const { 1.5 // return the init lock from the mirror 1.6 oop lock = java_lang_Class::init_lock(java_mirror()); 1.7 + // Prevent reordering with any access of initialization state 1.8 + OrderAccess::loadload(); 1.9 assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state 1.10 "only fully initialized state can have a null lock"); 1.11 return lock;