src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
branchJEP-349-branch
changeset 58158 369ebc2a11c2
parent 58157 9dca61a7df19
child 58159 892527a70da9
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Sun Sep 15 13:41:19 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Sun Sep 15 15:31:04 2019 +0200
@@ -41,7 +41,7 @@
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/mutexLocker.hpp"
+#include "runtime/mutex.hpp"
 #include "runtime/orderAccess.hpp"
 #include "runtime/os.inline.hpp"
 #include "runtime/safepoint.hpp"
@@ -378,18 +378,18 @@
 }
 
 size_t JfrCheckpointManager::write_types() {
-  ResourceMark rm;
-  HandleMark hm;
   Thread* const t = Thread::current();
+  ResourceMark rm(t);
+  HandleMark hm(t);
   JfrCheckpointWriter writer(t, get_epoch_transition_buffer(_epoch_transition_mspace, t), STATICS);
   JfrTypeManager::write_types(writer);
   return writer.used_size();
 }
 
 size_t JfrCheckpointManager::write_threads() {
-  ResourceMark rm;
-  HandleMark hm;
   Thread* const t = Thread::current();
+  ResourceMark rm(t);
+  HandleMark hm(t);
   JfrCheckpointWriter writer(t, get_epoch_transition_buffer(_epoch_transition_mspace, t), THREADS);
   JfrTypeManager::write_threads(writer);
   return writer.used_size();
@@ -428,7 +428,6 @@
 }
 
 void JfrCheckpointManager::write_type_set_for_unloaded_classes() {
-  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
   JfrTypeManager::write_type_set_for_unloaded_classes();
 }
 
@@ -463,4 +462,3 @@
   JfrTraceIdEpoch::shift_epoch();
   assert(current_epoch != JfrTraceIdEpoch::current(), "invariant");
 }
-