< prev index next >

src/hotspot/share/logging/logFileStreamOutput.hpp

Print this page
*** 96,6 ***
--- 96,20 ---
  };
  
  extern LogStderrOutput &StderrLog;
  extern LogStdoutOutput &StdoutLog;
  
+ class FileLocker : public StackObj {
+ private:
+     FILE *_file;
+ 
+ public:
+     FileLocker(FILE *file) : _file(file) {
+       os::flockfile(_file);
+     }
+ 
+     ~FileLocker() {
+       os::funlockfile(_file);
+     }
+ };
+ 
  #endif // SHARE_LOGGING_LOGFILESTREAMOUTPUT_HPP
< prev index next >