src/hotspot/share/prims/jvmtiImpl.cpp
changeset 48105 8d15b1369c7a
parent 47765 b7c7428eaab9
child 49360 886acec3b4c6
--- a/src/hotspot/share/prims/jvmtiImpl.cpp	Wed Nov 22 14:31:48 2017 -0500
+++ b/src/hotspot/share/prims/jvmtiImpl.cpp	Wed Nov 22 17:54:50 2017 -0800
@@ -46,6 +46,7 @@
 #include "runtime/serviceThread.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/thread.inline.hpp"
+#include "runtime/threadSMR.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vframe_hp.hpp"
 #include "runtime/vm_operations.hpp"
@@ -878,10 +879,9 @@
 
 void JvmtiSuspendControl::print() {
 #ifndef PRODUCT
-  MutexLocker mu(Threads_lock);
   LogStreamHandle(Trace, jvmti) log_stream;
   log_stream.print("Suspended Threads: [");
-  for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
+  for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
 #ifdef JVMTI_TRACE
     const char *name   = JvmtiTrace::safe_get_thread_name(thread);
 #else