mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8046210: Missing memory barrier when reading init_lock
Reviewed-by: fparain, dcubed, mdoerr
This commit is contained in:
parent
04e110cf2c
commit
88eb5fb4d6
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue