hotspot/src/share/vm/compiler/compileBroker.cpp
changeset 9138 35e4b04eadf4
parent 9103 535a93f494f6
child 9343 cf46e123429d
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Apr 13 14:33:03 2011 -0700
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Thu Apr 14 00:02:21 2011 -0700
@@ -1736,8 +1736,14 @@
   UseInterpreter = true;
   if (UseCompiler || AlwaysCompileLoopMethods ) {
     if (xtty != NULL) {
+      stringStream s;
+      // Dump code cache state into a buffer before locking the tty,
+      // because log_state() will use locks causing lock conflicts.
+      CodeCache::log_state(&s);
+      // Lock to prevent tearing
+      ttyLocker ttyl;
       xtty->begin_elem("code_cache_full");
-      CodeCache::log_state(xtty);
+      xtty->print(s.as_string());
       xtty->stamp();
       xtty->end_elem();
     }