8046210: Missing memory barrier when reading init_lock

Reviewed-by: fparain, dcubed, mdoerr
This commit is contained in:
Bill Pittore 2014-09-02 21:27:08 -04:00 committed by David Holmes
parent 04e110cf2c
commit 88eb5fb4d6

View file

@ -460,6 +460,8 @@ objArrayOop InstanceKlass::signers() const {
oop InstanceKlass::init_lock() const { oop InstanceKlass::init_lock() const {
// return the init lock from the mirror // return the init lock from the mirror
oop lock = java_lang_Class::init_lock(java_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 assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state
"only fully initialized state can have a null lock"); "only fully initialized state can have a null lock");
return lock; return lock;