changeset 26556:72da4c813e44

8046210: Missing memory barrier when reading init_lock Reviewed-by: fparain, dcubed, mdoerr Contributed-by: Bill Pittore <bill.pittore@oracle.com>
author dholmes
date Tue, 02 Sep 2014 21:27:08 -0400
parents 25abc4a3285c
children e399effe36f9
files hotspot/src/share/vm/oops/instanceKlass.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Sep 02 09:51:24 2014 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Sep 02 21:27:08 2014 -0400
@@ -460,6 +460,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;