< prev index next >

src/share/vm/prims/jvmtiEnvBase.hpp

Print this page
rev 9028 : 8223177: Data race on JvmtiEnvBase::_tag_map in double-checked locking
Summary: Add memory fences on accesses to JvmtiEnvBase::_tag_map
Reviewed-by: dholmes, jcbeyler, sspitsyn

*** 30,39 **** --- 30,40 ---- #include "prims/jvmtiEventController.hpp" #include "prims/jvmtiThreadState.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/frame.hpp" #include "runtime/handles.inline.hpp" + #include "runtime/orderAccess.hpp" #include "runtime/thread.hpp" #include "runtime/vm_operations.hpp" #include "utilities/growableArray.hpp" #include "utilities/macros.hpp"
*** 95,105 **** JvmtiEnvBase* _next; bool _is_retransformable; const void *_env_local_storage; // per env agent allocated data. jvmtiEventCallbacks _event_callbacks; jvmtiExtEventCallbacks _ext_event_callbacks; ! JvmtiTagMap* _tag_map; JvmtiEnvEventEnable _env_event_enable; jvmtiCapabilities _current_capabilities; jvmtiCapabilities _prohibited_capabilities; volatile bool _class_file_load_hook_ever_enabled; static volatile bool _needs_clean_up; --- 96,106 ---- JvmtiEnvBase* _next; bool _is_retransformable; const void *_env_local_storage; // per env agent allocated data. jvmtiEventCallbacks _event_callbacks; jvmtiExtEventCallbacks _ext_event_callbacks; ! JvmtiTagMap* volatile _tag_map; JvmtiEnvEventEnable _env_event_enable; jvmtiCapabilities _current_capabilities; jvmtiCapabilities _prohibited_capabilities; volatile bool _class_file_load_hook_ever_enabled; static volatile bool _needs_clean_up;
*** 249,258 **** --- 250,266 ---- JvmtiTagMap* tag_map() { return _tag_map; } + JvmtiTagMap* acquire_tag_map() { + return (JvmtiTagMap*)OrderAccess::load_ptr_acquire(&_tag_map); + } + + void release_set_tag_map(JvmtiTagMap* tag_map) { + OrderAccess::release_store_ptr(&_tag_map, tag_map); + } // return true if event is enabled globally or for any thread // True only if there is a callback for it. bool is_enabled(jvmtiEvent event_type) { return _env_event_enable.is_enabled(event_type);
< prev index next >