src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp
changeset 54623 1126f0607c70
parent 54562 1af5c0e68381
child 54645 05aaccf7d558
--- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Thu Apr 25 05:54:54 2019 -0700
+++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp	Thu Apr 25 10:56:31 2019 -0400
@@ -347,7 +347,7 @@
   jt->clear_trace_flag();
   JfrThreadLocal* const tl = jt->jfr_thread_local();
   if (tl->is_trace_block()) {
-    MutexLockerEx ml(JfrThreadSampler::transition_block(), Mutex::_no_safepoint_check_flag);
+    MutexLocker ml(JfrThreadSampler::transition_block(), Mutex::_no_safepoint_check_flag);
     JfrThreadSampler::transition_block()->notify_all();
   }
 }
@@ -395,9 +395,9 @@
   JfrThreadLocal* const tl = thread->jfr_thread_local();
   tl->set_trace_block();
   {
-    MutexLockerEx ml(transition_block(), Mutex::_no_safepoint_check_flag);
+    MutexLocker ml(transition_block(), Mutex::_no_safepoint_check_flag);
     while (thread->is_trace_suspend()) {
-      transition_block()->wait(true);
+      transition_block()->wait_without_safepoint_check();
     }
     tl->clear_trace_block();
   }
@@ -516,7 +516,7 @@
     elapsedTimer sample_time;
     sample_time.start();
     {
-      MonitorLockerEx tlock(Threads_lock, Mutex::_allow_vm_block_flag);
+      MutexLocker tlock(Threads_lock, Mutex::_no_safepoint_check_flag);
       ThreadsListHandle tlh;
       // Resolve a sample session relative start position index into the thread list array.
       // In cases where the last sampled thread is NULL or not-NULL but stale, find_index() returns -1.