< prev index next >

src/share/vm/logging/logFileOutput.cpp

Print this page

        

@@ -154,15 +154,12 @@
   }
   int written = LogFileStreamOutput::write(decorations, msg);
   _current_size += written;
 
   if (should_rotate()) {
-    MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */);
-    if (should_rotate()) {
       rotate();
     }
-  }
 
   return written;
 }
 
 void LogFileOutput::archive() {

@@ -181,10 +178,12 @@
                 _file_name, _archive_name, strerror(errno));
   }
 }
 
 void LogFileOutput::rotate() {
+  MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */);
+
   // Archive the current log file
   archive();
 
   // Open the active log file using the same stream as before
   _stream = freopen(_file_name, FileOpenMode, _stream);
< prev index next >