提交 40dc98c7 编写于 作者: D dholmes

8046210: Missing memory barrier when reading init_lock

Reviewed-by: fparain, dcubed, mdoerr
Contributed-by: NBill Pittore <bill.pittore@oracle.com>
上级 42793788
...@@ -504,6 +504,8 @@ objArrayOop InstanceKlass::signers() const { ...@@ -504,6 +504,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册