src/hotspot/share/compiler/compileBroker.cpp
changeset 58189 2f301425af62
parent 58177 4932dce35882
child 58545 725244418646
--- a/src/hotspot/share/compiler/compileBroker.cpp	Tue Sep 17 11:07:07 2019 +0000
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Tue Sep 17 20:38:23 2019 +0800
@@ -557,8 +557,14 @@
 }
 
 void CompileQueue::print_tty() {
-  ttyLocker ttyl;
-  print(tty);
+  ResourceMark rm;
+  stringStream ss;
+  // Dump the compile queue into a buffer before locking the tty
+  print(&ss);
+  {
+    ttyLocker ttyl;
+    tty->print("%s", ss.as_string());
+  }
 }
 
 CompilerCounters::CompilerCounters() {