src/hotspot/share/prims/jvmtiEnvBase.hpp
changeset 54674 27c8a2e0b0e5
parent 53244 9807daeb47c4
child 54690 7ab4310ed472
--- a/src/hotspot/share/prims/jvmtiEnvBase.hpp	Wed May 01 16:47:26 2019 -0700
+++ b/src/hotspot/share/prims/jvmtiEnvBase.hpp	Tue Apr 30 18:44:41 2019 -0700
@@ -32,6 +32,7 @@
 #include "oops/oopHandle.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/frame.hpp"
+#include "runtime/orderAccess.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/vmOperations.hpp"
 #include "utilities/growableArray.hpp"
@@ -98,7 +99,7 @@
   const void *_env_local_storage;     // per env agent allocated data.
   jvmtiEventCallbacks _event_callbacks;
   jvmtiExtEventCallbacks _ext_event_callbacks;
-  JvmtiTagMap* _tag_map;
+  JvmtiTagMap* volatile _tag_map;
   JvmtiEnvEventEnable _env_event_enable;
   jvmtiCapabilities _current_capabilities;
   jvmtiCapabilities _prohibited_capabilities;
@@ -253,6 +254,13 @@
     return _tag_map;
   }
 
+  JvmtiTagMap* acquire_tag_map() {
+    return OrderAccess::load_acquire(&_tag_map);
+  }
+
+  void release_set_tag_map(JvmtiTagMap* tag_map) {
+    OrderAccess::release_store(&_tag_map, tag_map);
+  }
 
   // return true if event is enabled globally or for any thread
   // True only if there is a callback for it.